From 45f008205fcd9861da1d8d6d2ae57cb7e200e1e3 Mon Sep 17 00:00:00 2001 From: Kris Wilson Date: Tue, 15 May 2018 21:00:59 -0700 Subject: [PATCH 1/2] Repair abi prefixing for PyPy. --- pex/platforms.py | 6 ++++-- tests/test_platform.py | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pex/platforms.py b/pex/platforms.py index b05edae45..132f4dfb9 100644 --- a/pex/platforms.py +++ b/pex/platforms.py @@ -49,8 +49,10 @@ def create(cls, platform): @staticmethod def _maybe_prefix_abi(impl, version, abi): - # N.B. This permits users to pass in simpler extended platform strings like - # `linux-x86_64-cp-27-mu` vs e.g. `linux-x86_64-cp-27-cp27mu`. + if impl != 'cp': + return abi + # N.B. This permits CPython users to pass in simpler extended platform + # strings like `linux-x86_64-cp-27-mu` vs e.g. `linux-x86_64-cp-27-cp27mu`. impl_ver = ''.join((impl, version)) return abi if abi.startswith(impl_ver) else ''.join((impl_ver, abi)) diff --git a/tests/test_platform.py b/tests/test_platform.py index 7ca1b8f80..f61c4926b 100644 --- a/tests/test_platform.py +++ b/tests/test_platform.py @@ -57,7 +57,6 @@ def test_platform_supported_tags_manylinux(): ) -@pytest.mark.skipif("(sys.version_info[0], sys.version_info[1]) == (2, 6)") def test_platform_supported_tags_osx_minimal(): assert_tags( 'macosx-10.4-x86_64', @@ -84,3 +83,12 @@ def test_platform_supported_tags_osx_full(): ('cp27', 'cp27m', 'macosx_10_12_x86_64'), ] ) + + +def test_pypy_abi_prefix(): + assert_tags( + 'linux-x86_64-pp-260-pypy_41', + [ + ('pp260', 'pypy_41', 'linux_x86_64'), + ] + ) From c1445ae2ecdc06022805ab7a309ce8cf11fcb6db Mon Sep 17 00:00:00 2001 From: Kris Wilson Date: Wed, 16 May 2018 09:59:24 -0700 Subject: [PATCH 2/2] Fixup. --- tests/test_platform.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_platform.py b/tests/test_platform.py index f61c4926b..94204f99a 100644 --- a/tests/test_platform.py +++ b/tests/test_platform.py @@ -3,8 +3,6 @@ import sys -import pytest - from pex.pep425tags import get_abi_tag, get_impl_tag from pex.platforms import Platform