aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-01-07 00:19:58 +0000
committerPJ Eby <distutils-sig@python.org>2006-01-07 00:19:58 +0000
commitf95da2a33da64374abfa0d5c45dd3e5d01d73bd3 (patch)
treebddf0ac3aef9731bd2bde31cc6bd02781bb88b01 /setuptools/package_index.py
parent5d732201ae2c910ebd00a882d33d70bc47056662 (diff)
downloadexternal_python_setuptools-f95da2a33da64374abfa0d5c45dd3e5d01d73bd3.tar.gz
external_python_setuptools-f95da2a33da64374abfa0d5c45dd3e5d01d73bd3.tar.bz2
external_python_setuptools-f95da2a33da64374abfa0d5c45dd3e5d01d73bd3.zip
PyPI searches now use the exact spelling of requirements specified on
the command line or in a project's ``install_requires``. Previously, a normalized form of the name was used, which could lead to unnecessary full-index searches when a project's name had an underscore (``_``) in it. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041942
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index df39b299..964e3c1c 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -245,12 +245,16 @@ class PackageIndex(Environment):
def find_packages(self, requirement):
- self.scan_url(self.index_url + requirement.project_name+'/')
+ self.scan_url(self.index_url + requirement.unsafe_name+'/')
+ if not self.package_pages.get(requirement.key):
+ # Fall back to safe version of the name
+ self.scan_url(self.index_url + requirement.project_name+'/')
+
if not self.package_pages.get(requirement.key):
# We couldn't find the target package, so search the index page too
self.warn(
"Couldn't find index page for %r (maybe misspelled?)",
- requirement.project_name
+ requirement.unsafe_name
)
if self.index_url not in self.fetched_urls:
self.warn(
@@ -281,10 +285,6 @@ class PackageIndex(Environment):
"; possible download problem?"
)
-
-
-
-
def download(self, spec, tmpdir):
"""Locate and/or download `spec` to `tmpdir`, returning a local path