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

Add python 2.x abi tag support #214

Merged
merged 1 commit into from
Mar 11, 2016
Merged
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
10 changes: 7 additions & 3 deletions pex/pep425.py
Original file line number Diff line number Diff line change
@@ -99,15 +99,19 @@ def _iter_supported_tags(cls, impl, version, platform):
"""
# Predict soabi for reasonable interpreters. This is technically wrong but essentially right.
abis = []
if impl == 'cp' and version.startswith('3'):
if impl == 'cp' and (version.startswith('2') or version.startswith('3')):
abis.extend([
'cp%s' % version,
'cp%sdmu' % version, 'cp%sdm' % version, 'cp%sdu' % version, 'cp%sd' % version,
'cp%smu' % version, 'cp%sm' % version,
'cp%su' % version,
'abi3'
'cp%su' % version
])

if version.startswith('3'):
abis.extend([
'abi3'
])

major_version = int(version[0])
minor_versions = []
for minor in range(int(version[1]), -1, -1):
14 changes: 13 additions & 1 deletion tests/test_pep425.py
Original file line number Diff line number Diff line change
@@ -46,6 +46,18 @@ def iter_solutions():
for interp in ('cp', 'py'):
for interp_suffix in ('2', '20', '21', '22', '23', '24', '25', '26'):
for platform in ('linux_x86_64', 'any'):
yield (interp + interp_suffix, 'none', platform)
abis = ['none']

if interp == 'cp' and interp_suffix == '26' and platform == 'linux_x86_64':
abis.extend([
'cp%s' % interp_suffix,
'cp%sdmu' % interp_suffix, 'cp%sdm' % interp_suffix,
'cp%sdu' % interp_suffix, 'cp%sd' % interp_suffix,
'cp%smu' % interp_suffix, 'cp%sm' % interp_suffix,
'cp%su' % interp_suffix
])

for abi in abis:
yield (interp + interp_suffix, abi, platform)

assert set(PEP425.iter_supported_tags(identity, platform)) == set(iter_solutions())