Skip to content

Commit c68a56d

Browse files
committed
Merge pull request #2915 from minrk/soabi-cp35-split
get only first part of SOABI for ABI tag
2 parents 759eba0 + 659d81d commit c68a56d

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

pip/pep425tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_supported(versions=None, noarch=False):
6767
soabi = None
6868

6969
if soabi and soabi.startswith('cpython-'):
70-
abis[0:0] = ['cp' + soabi.split('-', 1)[-1]]
70+
abis[0:0] = ['cp' + soabi.split('-')[1]]
7171

7272
abi3s = set()
7373
import imp

tests/unit/test_wheel.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,27 @@ def raises_ioerror(var):
307307
with patch('pip.pep425tags.sysconfig.get_config_var', raises_ioerror):
308308
assert len(pip.pep425tags.get_supported())
309309

310+
def test_no_hyphen_tag(self):
311+
"""
312+
Test that no tag contains a hyphen.
313+
"""
314+
import pip.pep425tags
315+
316+
get_config_var = pip.pep425tags.sysconfig.get_config_var
317+
318+
def mock_soabi(var):
319+
if var == 'SOABI':
320+
return 'cpython-35m-darwin'
321+
return get_config_var(var)
322+
323+
with patch('pip.pep425tags.sysconfig.get_config_var', mock_soabi):
324+
supported = pip.pep425tags.get_supported()
325+
326+
for (py, abi, plat) in supported:
327+
assert '-' not in py
328+
assert '-' not in abi
329+
assert '-' not in plat
330+
310331

311332
class TestMoveWheelFiles(object):
312333
"""

0 commit comments

Comments
 (0)