From 45d883588394cd80231fd7bd8cd4f19e4012b095 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 25 Apr 2020 14:54:26 +0200 Subject: [PATCH] Allow manylinux_x_y wheel upload (PEP600) manylinux_x_y platform tag is official per PEP600 see also pypa/manylinux#542 --- 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 99067b8962ec..9d4e484787ed 100644 --- a/tests/unit/forklift/test_legacy.py +++ b/tests/unit/forklift/test_legacy.py @@ -2294,6 +2294,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 703272af5c9b..638e68baaf7e 100644 --- a/warehouse/forklift/legacy.py +++ b/warehouse/forklift/legacy.py @@ -127,6 +127,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; @@ -136,6 +147,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