Repository: peterbe/hashin

Issue:
Unrecognizable url Error
This one works:
```
hashin turbine
```

This one doesn't:
```
hashin turbine --python-version 2.7
```

```
Traceback (most recent call last):
  File "/Users/j/dev/.virtualenvs/hashin/bin/hashin", line 11, in <module>
    sys.exit(main())
  File "/Users/j/dev/.virtualenvs/hashin/lib/python3.5/site-packages/hashin.py", line 331, in main
    verbose=args.verbose,
  File "/Users/j/dev/.virtualenvs/hashin/lib/python3.5/site-packages/hashin.py", line 63, in run
    run_single_package(spec, *args, **kwargs)
  File "/Users/j/dev/.virtualenvs/hashin/lib/python3.5/site-packages/hashin.py", line 92, in run_single_package
    releases = filter_releases(releases, python_versions)
  File "/Users/j/dev/.virtualenvs/hashin/lib/python3.5/site-packages/hashin.py", line 255, in filter_releases
    metadata = release_url_metadata(release['url'])
  File "/Users/j/dev/.virtualenvs/hashin/lib/python3.5/site-packages/hashin.py", line 248, in release_url_metadata
    raise PackageError('Unrecognizable url: ' + url)
hashin.PackageError: Unrecognizable url: https://pypi.python.org/packages/a4/ae/65500d0becffe3dd6671fbdc6010cc0c4a8b715dbd94315ba109bbc54bc5/turbine-0.0.3.linux-x86_64.tar.gz
```

Discussion:

Patch:
diff --git a/hashin.py b/hashin.py
index 8946bc7..bb3b378 100755
--- a/hashin.py
+++ b/hashin.py
@@ -234,6 +234,7 @@ CLASSIFY_EGG_RE = re.compile('''
 CLASSIFY_ARCHIVE_RE = re.compile('''
     ^(?P<package>.+)-
     (?P<version>\d[^-]*)
+    (-(?P<platform>[^\.]+))?
     .(?P<format>tar.(gz|bz2)|zip)
     (\#md5=.*)?
     $


Test patch:
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 @@ selenium==2.53.1 \
             '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')),