1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Yet another fix for finding requirements with absolute versions, uses the main index now, if given.

This commit is contained in:
Jannis Leidel 2009-09-01 17:55:50 +02:00
parent f563f75a91
commit 34954314ca

5
pip.py
View file

@ -1089,6 +1089,7 @@ class PackageFinder(object):
def find_requirement(self, req, upgrade):
url_name = req.url_name
# Only check main index if index URL is given:
main_index_url = None
if self.index_urls:
# Check that we have the url_name correctly spelled:
main_index_url = Link(posixpath.join(self.index_urls[0], url_name))
@ -1113,9 +1114,9 @@ class PackageFinder(object):
locations = list(self.find_links)
locations.extend(self.dependency_links)
for version in req.absolute_versions:
if url_name is not None and url is not None:
if url_name is not None and main_index_url is not None:
locations = [
posixpath.join(url, url_name, version)] + locations
posixpath.join(main_index_url.url, version)] + locations
file_locations = []
url_locations = []
for url in locations: