python-setuptools/distribute-b045d0750c13.diff
Toshio くらとみ 1983a88b4e - Upstream patch for compatibility problem with setuptools
- Minor spec cleanups
- Provide python-distribute for those who see an import distribute and need
    to get the proper package.
2010-07-03 18:58:02 +00:00

67 lines
2.3 KiB
Diff

# HG changeset patch -- Bitbucket.org
# Project distribute
# URL http://bitbucket.org/tarek/distribute/overview
# User David Cournapeau <david@silveregg.co.jp>
# Date 1274351504 -32400
# Node ID b045d0750c13d83ef577593b8bb267a10e803aca
# Parent ab666b0eacbb5523ffb42a412451550f55347fcc
BUG: Fix #142 - easy_install ignore locally installed packages.
Backport from setuptools 0.6c10.
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -565,7 +565,8 @@ Please make the appropriate changes for
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:
--- 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)
- 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:
self.prescan()
dist = find(requirement)