Tarek Ziadé avatar Tarek Ziadé committed c9289a9 Merge

merging changes relates #142

Comments (0)

Files changed (5)

 * Issue 170: Fixed unittest failure. Thanks to Toshio.
 * Issue 171: Fixed race condition in unittests cause deadlocks in test suite.
+* Issue 143: Fixed a lookup issue with easy_install.
+  Thanks to David and Zooko.


 easy_install = setuptools.command.easy_install:main
-easy_install-2.5 = setuptools.command.easy_install:main
+easy_install-2.6 = setuptools.command.easy_install:main
 svn_cvs = setuptools.command.sdist:_default_revctrl


             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:


     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`
         # 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:
         if force_scan:
+            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:
             dist = find(requirement)


 """Basic http server for tests to simulate PyPI or custom indexes
 import urllib2
+import sys
 from threading import Thread
 from BaseHTTPServer import HTTPServer
 from SimpleHTTPServer import SimpleHTTPRequestHandler
         """self.shutdown is not supported on python < 2.6"""
         self._run = False
-            urllib2.urlopen('' % self.server_port, None, 5)
+            if sys.version > '2.6':
+                urllib2.urlopen('' % self.server_port,
+                                None, 5)
+            else:
+                urllib2.urlopen('' % self.server_port)
         except urllib2.URLError:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.