Skip to content

Commit

Permalink
Update CLASSIFY_EXE_RE to parse ntlk win package (#72)
Browse files Browse the repository at this point in the history
* Update CLASSIFY_EXE_RE to parse ntlk win package

They've published nltk-3.2.4.win32.exe which hashin can't parse

* Adding a test for commit 55741fb
  • Loading branch information
chrispbailey authored and Peter Bengtsson committed Aug 8, 2018
1 parent 4e7bca4 commit 9572761
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hashin.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def expand_python_version(version):

CLASSIFY_EXE_RE = re.compile('''
^(?P<package>.+)-
(?P<version>\d[^-]*)-
(?P<version>\d[^-]*)[-\.]
((?P<platform>[^-]*)-)?
(?P<python_version>[^-]+)
.(?P<format>(exe|msi))
Expand Down
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,15 @@ def test_release_url_metadata_python(self):
'platform': None,
'format': 'egg',
})
url = 'https://files.pythonhosted.org/packages/26/01/0330e3ba13628827f10fcd6c3c8d778a5aa3e4d0a09d05619f074ba2d87e/nltk-3.2.4.win32.exe'
self.assertEqual(hashin.release_url_metadata(url), {
'package': 'nltk',
'version': '3.2.4',
'python_version': mock.ANY,
'abi': None,
'platform': None,
'format': 'exe',
})
url = 'https://pypi.org/packages/2.7/g/gevent/gevent-1.1.0.win-amd64-py2.7.exe'
self.assertEqual(hashin.release_url_metadata(url), {
'package': 'gevent',
Expand Down

0 comments on commit 9572761

Please sign in to comment.