aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsetuptools/command/easy_install.py3
-rwxr-xr-xsetuptools/package_index.py15
2 files changed, 13 insertions, 5 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index d68943fa..e13f676a 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -565,7 +565,8 @@ Please make the appropriate changes for your system and try again.
self.check_editable(spec)
dist = self.package_index.fetch_distribution(
- spec, tmpdir, self.upgrade, self.editable, not self.always_copy
+ spec, tmpdir, self.upgrade, self.editable, not self.always_copy,
+ self.local_index
)
if dist is None:
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 1c50d86f..67e9f6ae 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -418,7 +418,8 @@ class PackageIndex(Environment):
def fetch_distribution(self,
- requirement, tmpdir, force_scan=False, source=False, develop_ok=False
+ requirement, tmpdir, force_scan=False, source=False, develop_ok=False,
+ local_index=None
):
"""Obtain a distribution suitable for fulfilling `requirement`
@@ -440,11 +441,14 @@ class PackageIndex(Environment):
# process a Requirement
self.info("Searching for %s", requirement)
skipped = {}
+ dist = None
- def find(req):
+ def find(req, env=None):
+ if env is None:
+ env = self
# Find a matching distribution; may be called more than once
- for dist in self[req.key]:
+ for dist in env[req.key]:
if dist.precedence==DEVELOP_DIST and not develop_ok:
if dist not in skipped:
@@ -461,8 +465,11 @@ class PackageIndex(Environment):
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)
- dist = find(requirement)
if dist is None and self.to_scan is not None:
self.prescan()
dist = find(requirement)