Commit 346215d9 authored by PJ Eby's avatar PJ Eby

Support setuptools .egg being in current directory when bootstrapping on

an offline machine.  Output what version/location is conflicting when a
newer version of setuptools is requested.

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4051778
parent c63bb77e
......@@ -1194,6 +1194,9 @@ Release Notes/Change History
* Windows script wrappers now support quoted arguments and arguments
containing spaces. (Patch contributed by Jim Fulton.)
* The ``ez_setup.py`` script now actually works when you put a setuptools
``.egg`` alongside it for bootstrapping an offline machine.
0.6c1
* EasyInstall now includes setuptools version information in the
``User-Agent`` string sent to websites it visits.
......
......@@ -77,13 +77,13 @@ def use_setuptools(
try:
pkg_resources.require("setuptools>="+version)
except pkg_resources.VersionConflict:
except pkg_resources.VersionConflict, e:
# XXX could we install in a subprocess here?
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
" a more recent version first."
) % version
" a more recent version first.\n\n(Currently using %r)"
) % (version, e.args[0])
sys.exit(2)
def download_setuptools(
......@@ -139,15 +139,15 @@ def main(argv, version=DEFAULT_VERSION):
try:
import setuptools
except ImportError:
import tempfile, shutil
tmpdir = tempfile.mkdtemp(prefix="easy_install-")
egg = None
try:
egg = download_setuptools(version, to_dir=tmpdir, delay=0)
egg = download_setuptools(version, delay=0)
sys.path.insert(0,egg)
from setuptools.command.easy_install import main
return main(list(argv)+[egg]) # we're done here
finally:
shutil.rmtree(tmpdir)
if egg and os.path.exists(egg):
os.unlink(egg)
else:
if setuptools.__version__ == '0.0.1':
# tell the user to uninstall obsolete version
......
......@@ -2563,6 +2563,11 @@ XXX
Release Notes/Change History
----------------------------
0.6c2
* The ``ez_setup`` module displays the conflicting version of setuptools (and
its installation location) when a script requests a version that's not
available.
0.6c1
* Fixed ``AttributeError`` when trying to download a ``setup_requires``
dependency when a distribution lacks a ``dependency_links`` setting.
......
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