mirror of https://github.com/pypa/pip
move critical warning to find_requirement
and away of _find_all_versions that will return an empty list
This commit is contained in:
parent
a25bfa968c
commit
39c24740d8
47
pip/index.py
47
pip/index.py
|
@ -379,10 +379,28 @@ class PackageFinder(object):
|
||||||
req.name.lower()
|
req.name.lower()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if (not find_links_versions and not
|
if file_versions:
|
||||||
page_versions and not
|
file_versions.sort(reverse=True)
|
||||||
dependency_versions and not
|
logger.debug(
|
||||||
file_versions):
|
'Local files found: %s',
|
||||||
|
', '.join([
|
||||||
|
url_to_path(candidate.location.url)
|
||||||
|
for candidate in file_versions
|
||||||
|
])
|
||||||
|
)
|
||||||
|
|
||||||
|
# This is an intentional priority ordering
|
||||||
|
return (
|
||||||
|
file_versions + find_links_versions + page_versions +
|
||||||
|
dependency_versions
|
||||||
|
)
|
||||||
|
|
||||||
|
def find_requirement(self, req, upgrade):
|
||||||
|
"""Expects req, an InstallRequirement and upgrade, a boolean
|
||||||
|
Returns an InstallationCandidate or None
|
||||||
|
May raise DistributionNotFound or BestVersionAlreadyInstalled"""
|
||||||
|
all_versions = self._find_all_versions(req)
|
||||||
|
if not all_versions:
|
||||||
logger.critical(
|
logger.critical(
|
||||||
'Could not find any downloads that satisfy the requirement %s',
|
'Could not find any downloads that satisfy the requirement %s',
|
||||||
req,
|
req,
|
||||||
|
@ -406,27 +424,6 @@ class PackageFinder(object):
|
||||||
raise DistributionNotFound(
|
raise DistributionNotFound(
|
||||||
'No distributions at all found for %s' % req
|
'No distributions at all found for %s' % req
|
||||||
)
|
)
|
||||||
if file_versions:
|
|
||||||
file_versions.sort(reverse=True)
|
|
||||||
logger.debug(
|
|
||||||
'Local files found: %s',
|
|
||||||
', '.join([
|
|
||||||
url_to_path(candidate.location.url)
|
|
||||||
for candidate in file_versions
|
|
||||||
])
|
|
||||||
)
|
|
||||||
|
|
||||||
# This is an intentional priority ordering
|
|
||||||
return (
|
|
||||||
file_versions + find_links_versions + page_versions +
|
|
||||||
dependency_versions
|
|
||||||
)
|
|
||||||
|
|
||||||
def find_requirement(self, req, upgrade):
|
|
||||||
"""Expects req, an InstallRequirement and upgrade, a boolean
|
|
||||||
Returns an InstallationCandidate or None
|
|
||||||
May raise DistributionNotFound or BestVersionAlreadyInstalled"""
|
|
||||||
all_versions = self._find_all_versions(req)
|
|
||||||
# Filter out anything which doesn't match our specifier
|
# Filter out anything which doesn't match our specifier
|
||||||
_versions = set(
|
_versions = set(
|
||||||
req.specifier.filter(
|
req.specifier.filter(
|
||||||
|
|
Loading…
Reference in New Issue