Commit 5c7f1d08 authored by Tarek Ziade's avatar Tarek Ziade

merging changes relates #142

--HG--
branch : distribute
extra : rebase_source : e912f048dcfe28a5a7a17aca89bab427e15924ff
parents 79a00a31 72c44b32
...@@ -8,6 +8,8 @@ CHANGES ...@@ -8,6 +8,8 @@ CHANGES
* Issue 170: Fixed unittest failure. Thanks to Toshio. * Issue 170: Fixed unittest failure. Thanks to Toshio.
* Issue 171: Fixed race condition in unittests cause deadlocks in test suite. * 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 0.6.13
......
...@@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete ...@@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete
[console_scripts] [console_scripts]
easy_install = setuptools.command.easy_install:main 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] [setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl svn_cvs = setuptools.command.sdist:_default_revctrl
......
...@@ -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)
......
"""Basic http server for tests to simulate PyPI or custom indexes """Basic http server for tests to simulate PyPI or custom indexes
""" """
import urllib2 import urllib2
import sys
from threading import Thread from threading import Thread
from BaseHTTPServer import HTTPServer from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler from SimpleHTTPServer import SimpleHTTPRequestHandler
...@@ -33,7 +34,11 @@ class IndexServer(HTTPServer): ...@@ -33,7 +34,11 @@ class IndexServer(HTTPServer):
"""self.shutdown is not supported on python < 2.6""" """self.shutdown is not supported on python < 2.6"""
self._run = False self._run = False
try: 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: except urllib2.URLError:
pass pass
self.thread.join() self.thread.join()
......
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