Commit 1b94bbac authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #609 from JensTimmerman/check_downloads

check if a download is successfull before deciding not to try the nex…
parents a4b7c659 87c77622
......@@ -19,6 +19,11 @@ v25.0.1
* More style cleanup. See #677, #678, #679, #681, #685.
* #609: setuptools will now try to download a distribution from
the next possible download location if the first download fails.
This means you can now specify multiple links as ``dependency_links``
and all links will be tried until a working download link is encountered.
v25.0.0
-------
......
......@@ -602,15 +602,17 @@ class PackageIndex(Environment):
continue
if dist in req and (dist.precedence <= SOURCE_DIST or not source):
return dist
dist.download_location = self.download(dist.location, tmpdir)
if os.path.exists(dist.download_location):
return dist
if force_scan:
self.prescan()
self.find_packages(requirement)
dist = find(requirement)
if local_index is not None:
dist = dist or find(requirement, local_index)
if not dist and local_index is not None:
dist = find(requirement, local_index)
if dist is None:
if self.to_scan is not None:
......@@ -623,13 +625,13 @@ class PackageIndex(Environment):
if dist is None:
self.warn(
"No local packages or download links found for %s%s",
"No local packages or working download links found for %s%s",
(source and "a source distribution of " or ""),
requirement,
)
else:
self.info("Best match: %s", dist)
return dist.clone(location=self.download(dist.location, tmpdir))
return dist.clone(location=dist.download_location)
def fetch(self, requirement, tmpdir, force_scan=False, source=False):
"""Obtain a file suitable for fulfilling `requirement`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment