Skip to content

Commit 30a6733

Browse files
authored
Add support for musllinux (#9982)
1 parent ea13cb1 commit 30a6733

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

tests/unit/forklift/test_legacy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,6 +2573,7 @@ def test_upload_fails_without_permission(self, pyramid_config, db_request):
25732573
"manylinux_2_17_ppc64",
25742574
"manylinux_2_17_ppc64le",
25752575
"manylinux_3_0_s390x",
2576+
"musllinux_1_1_x86_64",
25762577
"macosx_10_6_intel",
25772578
"macosx_10_13_x86_64",
25782579
"macosx_11_0_x86_64",

warehouse/forklift/legacy.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,18 @@ def namespace_stdlib_list(module_list):
143143
"11",
144144
}
145145

146-
# manylinux pep600 is a little more complicated:
147-
_manylinux_platform_re = re.compile(r"manylinux_(\d+)_(\d+)_(?P<arch>.*)")
148-
_manylinux_arches = {
146+
# manylinux pep600 and musllinux pep656 are a little more complicated:
147+
_linux_platform_re = re.compile(r"(?P<libc>(many|musl))linux_(\d+)_(\d+)_(?P<arch>.*)")
148+
_jointlinux_arches = {
149149
"x86_64",
150150
"i686",
151151
"aarch64",
152152
"armv7l",
153-
"ppc64",
154153
"ppc64le",
155154
"s390x",
156155
}
156+
_manylinux_arches = _jointlinux_arches | {"ppc64"}
157+
_musllinux_arches = _jointlinux_arches
157158

158159

159160
# Actual checking code;
@@ -167,9 +168,11 @@ def _valid_platform_tag(platform_tag):
167168
and m.group("arch") in _macosx_arches
168169
):
169170
return True
170-
m = _manylinux_platform_re.match(platform_tag)
171-
if m and m.group("arch") in _manylinux_arches:
172-
return True
171+
m = _linux_platform_re.match(platform_tag)
172+
if m and m.group("libc") == "musl":
173+
return m.group("arch") in _musllinux_arches
174+
if m and m.group("libc") == "many":
175+
return m.group("arch") in _manylinux_arches
173176
return False
174177

175178

0 commit comments

Comments
 (0)