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.
 
 ------
 0.6.13

distribute.egg-info/entry_points.txt

 
 [console_scripts]
 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
 
 [setuptools.file_finders]
 svn_cvs = setuptools.command.sdist:_default_revctrl

setuptools/command/easy_install.py

 
             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:

setuptools/package_index.py

 
 
     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:
             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)

setuptools/tests/server.py

 """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
         try:
-            urllib2.urlopen('http://127.0.0.1:%s/' % self.server_port, None, 5)
+            if sys.version > '2.6':
+                urllib2.urlopen('http://127.0.0.1:%s/' % self.server_port,
+                                None, 5)
+            else:
+                urllib2.urlopen('http://127.0.0.1:%s/' % self.server_port)
         except urllib2.URLError:
             pass
         self.thread.join()
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.