Skip to content

Commit

Permalink
Add support for platform-specific archives (#33)
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
Mike Cooper authored and Peter Bengtsson committed Dec 18, 2016
1 parent 6549e7a commit f1f8fe5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions hashin.py
Expand Up @@ -234,6 +234,7 @@ def expand_python_version(version):
CLASSIFY_ARCHIVE_RE = re.compile('''
^(?P<package>.+)-
(?P<version>\d[^-]*)
(-(?P<platform>[^\.]+))?
.(?P<format>tar.(gz|bz2)|zip)
(\#md5=.*)?
$
Expand Down
10 changes: 10 additions & 0 deletions tests/test_cli.py
Expand Up @@ -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')),
Expand Down

0 comments on commit f1f8fe5

Please sign in to comment.