diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-10-22 12:44:53 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-10-22 12:44:53 -0400 |
commit | 6fc5d3099898fc3d06bcf72f1f6607d02124d60f (patch) | |
tree | c3d88a729e9e8f7d89ab6653582df9a6eb55bd88 /setuptools/package_index.py | |
parent | a9d3576584cd9a91734dae6473ab6c3253f09f64 (diff) | |
download | python-setuptools-git-6fc5d3099898fc3d06bcf72f1f6607d02124d60f.tar.gz |
Update test_egg_fragment to include a name with a dash in it. Expand on interpret_distro_name to be a tiny bit smarter about inferring the pivot separating name and version.
Diffstat (limited to 'setuptools/package_index.py')
-rw-r--r-- | setuptools/package_index.py | 9 |
1 files changed, 8 insertions, 1 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, |