From 8815e29f36c743e68b08e6abd40eed014748cbcc Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Fri, 14 Aug 2020 00:26:15 +0200 Subject: [PATCH] Allow manylinux_x_y wheel upload (PEP600) (#7853) manylinux_x_y platform tag is official per PEP600 see also pypa/manylinux#542 Co-authored-by: Dustin Ingram --- tests/unit/forklift/test_legacy.py | 7 +++++++ warehouse/forklift/legacy.py | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/tests/unit/forklift/test_legacy.py b/tests/unit/forklift/test_legacy.py index 98694ff3a47e..477c425ab545 100644 --- a/tests/unit/forklift/test_legacy.py +++ b/tests/unit/forklift/test_legacy.py @@ -2514,6 +2514,13 @@ def test_upload_fails_without_permission(self, pyramid_config, db_request): "manylinux2014_ppc64", "manylinux2014_ppc64le", "manylinux2014_s390x", + "manylinux_2_5_i686", + "manylinux_2_12_x86_64", + "manylinux_2_17_aarch64", + "manylinux_2_17_armv7l", + "manylinux_2_17_ppc64", + "manylinux_2_17_ppc64le", + "manylinux_3_0_s390x", "macosx_10_6_intel", "macosx_10_13_x86_64", # A real tag used by e.g. some numpy wheels diff --git a/warehouse/forklift/legacy.py b/warehouse/forklift/legacy.py index b3816fd8f373..2834f2ebf7df 100644 --- a/warehouse/forklift/legacy.py +++ b/warehouse/forklift/legacy.py @@ -137,6 +137,17 @@ def namespace_stdlib_list(module_list): "fat64", "universal", } +# manylinux pep600 is a little more complicated: +_manylinux_platform_re = re.compile(r"manylinux_(\d+)+_(\d+)+_(?P.*)") +_manylinux_arches = { + "x86_64", + "i686", + "aarch64", + "armv7l", + "ppc64", + "ppc64le", + "s390x", +} # Actual checking code; @@ -146,6 +157,9 @@ def _valid_platform_tag(platform_tag): m = _macosx_platform_re.match(platform_tag) if m and m.group("arch") in _macosx_arches: return True + m = _manylinux_platform_re.match(platform_tag) + if m and m.group("arch") in _manylinux_arches: + return True return False