Commit 72c44b32 authored by David Cournapeau's avatar David Cournapeau

BUG: Fix #142 - easy_install ignore locally installed packages.

Backport from setuptools 0.6c10.

--HG--
branch : distribute
extra : rebase_source : d06cbdae906a725410d4993d9e1a631e2acac345
parent 0c8f3ad9
...@@ -565,7 +565,8 @@ Please make the appropriate changes for your system and try again. ...@@ -565,7 +565,8 @@ Please make the appropriate changes for your system and try again.
self.check_editable(spec) self.check_editable(spec)
dist = self.package_index.fetch_distribution( 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: if dist is None:
......
...@@ -418,7 +418,8 @@ class PackageIndex(Environment): ...@@ -418,7 +418,8 @@ class PackageIndex(Environment):
def fetch_distribution(self, 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` """Obtain a distribution suitable for fulfilling `requirement`
...@@ -440,11 +441,14 @@ class PackageIndex(Environment): ...@@ -440,11 +441,14 @@ class PackageIndex(Environment):
# process a Requirement # process a Requirement
self.info("Searching for %s", requirement) self.info("Searching for %s", requirement)
skipped = {} 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 # 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.precedence==DEVELOP_DIST and not develop_ok:
if dist not in skipped: if dist not in skipped:
...@@ -461,8 +465,11 @@ class PackageIndex(Environment): ...@@ -461,8 +465,11 @@ class PackageIndex(Environment):
if force_scan: if force_scan:
self.prescan() self.prescan()
self.find_packages(requirement) self.find_packages(requirement)
dist = find(requirement) dist = find(requirement)
if local_index is not None:
dist = dist or find(requirement, local_index)
if dist is None and self.to_scan is not None: if dist is None and self.to_scan is not None:
self.prescan() self.prescan()
dist = find(requirement) dist = find(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