Skip to content

Commit

Permalink
Fixed single digit versions not working
Browse files Browse the repository at this point in the history
Fixes #208.
  • Loading branch information
agronholm committed Dec 30, 2017
1 parent d120bf9 commit 88c480e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased
==========
- Fixed displaying of errors on Python 3
- Fixed single digit versions in wheel files not being properly recognized

0.30.0
======
Expand Down
6 changes: 6 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ def get_supported():
def test_install_tool():
"""Slightly improve coverage of wheel.install"""
wheel.tool.install([TESTWHEEL], force=True, dry_run=True)


def test_wheelfile_re():
# Regression test for #208
wf = WheelFile('foo-2-py3-none-any.whl')
assert wf.distinfo_name == 'foo-2.dist-info'
5 changes: 2 additions & 3 deletions wheel/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
# Non-greedy matching of an optional build number may be too clever (more
# invalid wheel filenames will match). Separate regex for .dist-info?
WHEEL_INFO_RE = re.compile(
r"""^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
\.whl|\.dist-info)$""",
r"""^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))(-(?P<build>\d.*?))?
-(?P<pyver>[a-z].+?)-(?P<abi>.+?)-(?P<plat>.+?)(\.whl|\.dist-info)$""",
re.VERBOSE).match


Expand Down

0 comments on commit 88c480e

Please sign in to comment.