diff options
-rw-r--r-- | setuptools/package_index.py | 9 | ||||
-rw-r--r-- | setuptools/tests/test_packageindex.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 1300b406..bef2ef81 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -165,7 +165,14 @@ def interpret_distro_name( # it is a bdist_dumb, not an sdist -- bail out return - p = len(parts) - 1 + # find the pivot (p) that splits the name from the version. + # infer the version as the first item that has a digit. + for p in range(len(parts)): + if parts[p][:1].isdigit(): + break + else: + p = len(parts) + yield Distribution( location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]), py_version=py_version, precedence=precedence, diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 8e9435ef..5f09e1bd 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -189,7 +189,7 @@ class TestPackageIndex: for locs in local] for v, vc in versions: dists = list(setuptools.package_index.distros_for_url( - 'http://example.com/example.zip#egg=example-' + v)) + 'http://example.com/example-foo.zip#egg=example-foo-' + v)) assert dists[0].version == '' assert dists[1].version == vc |