mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #1158 from qwcode/fix_1150
we'll assume '_' means '-' in versions from wheel filenames
This commit is contained in:
commit
4a722c6eba
2 changed files with 11 additions and 1 deletions
|
@ -246,7 +246,9 @@ class Wheel(object):
|
|||
wheel_info = self.wheel_file_re.match(filename)
|
||||
self.filename = filename
|
||||
self.name = wheel_info.group('name').replace('_', '-')
|
||||
self.version = wheel_info.group('ver')
|
||||
# we'll assume "_" means "-" due to wheel naming scheme
|
||||
# (https://github.com/pypa/pip/issues/1150)
|
||||
self.version = wheel_info.group('ver').replace('_', '-')
|
||||
self.pyversions = wheel_info.group('pyver').split('.')
|
||||
self.abis = wheel_info.group('abi').split('.')
|
||||
self.plats = wheel_info.group('plat').split('.')
|
||||
|
|
|
@ -163,6 +163,14 @@ class TestWheelFile(object):
|
|||
for name, path, expected in packages:
|
||||
assert wheel.root_is_purelib(name, path) == expected
|
||||
|
||||
def test_version_underscore_conversion(self):
|
||||
"""
|
||||
Test that we convert '_' to '-' for versions parsed out of wheel filenames
|
||||
"""
|
||||
w = wheel.Wheel('simple-0.1_1-py2-none-any.whl')
|
||||
assert w.version == '0.1-1'
|
||||
|
||||
|
||||
class TestPEP425Tags(object):
|
||||
|
||||
def test_broken_sysconfig(self):
|
||||
|
|
Loading…
Reference in a new issue