Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair abi prefixing for PyPy. #483

Merged
merged 2 commits into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pex/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
12 changes: 9 additions & 3 deletions tests/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import sys

import pytest

from pex.pep425tags import get_abi_tag, get_impl_tag
from pex.platforms import Platform

Expand Down Expand Up @@ -57,7 +55,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',
Expand All @@ -84,3 +81,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'),
]
)