diff --git a/hashin.py b/hashin.py index 8946bc7..bb3b378 100755 --- a/hashin.py +++ b/hashin.py @@ -234,6 +234,7 @@ def expand_python_version(version): CLASSIFY_ARCHIVE_RE = re.compile(''' ^(?P.+)- (?P\d[^-]*) + (-(?P[^\.]+))? .(?Ptar.(gz|bz2)|zip) (\#md5=.*)? $ diff --git a/tests/test_cli.py b/tests/test_cli.py index cb6b306..9679059 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -527,6 +527,16 @@ def test_release_url_metadata_python(self): 'platform': 'any', 'format': 'whl', }) + # issue 32 + url = 'https://pypi.python.org/packages/a4/ae/65500d0becffe3dd6671fbdc6010cc0c4a8b715dbd94315ba109bbc54bc5/turbine-0.0.3.linux-x86_64.tar.gz' + self.assertEqual(hashin.release_url_metadata(url), { + 'package': 'turbine', + 'version': '0.0.3.linux', + 'python_version': 'source', + 'abi': None, + 'platform': 'x86_64', + 'format': 'tar.gz', + }) def test_expand_python_version(self): self.assertEqual(sorted(hashin.expand_python_version('2.7')),