phillip.eby  committed 4d16b36

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.

  • Participants
  • Parent commits 3735d0d
  • Branches setuptools-0.6

Comments (0)

Files changed (3)

File EasyInstall.txt

  * Windows script wrappers now support quoted arguments and arguments
    containing spaces.  (Patch contributed by Jim Fulton.)
+ * The ```` script now actually works when you put a setuptools
+   ``.egg`` alongside it for bootstrapping an offline machine.
  * EasyInstall now includes setuptools version information in the
    ``User-Agent`` string sent to websites it visits.
-    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])
 def download_setuptools(
         import setuptools
     except ImportError:
-        import tempfile, shutil
-        tmpdir = tempfile.mkdtemp(prefix="easy_install-")
+        egg = None
-            egg = download_setuptools(version, to_dir=tmpdir, delay=0)
+            egg = download_setuptools(version, delay=0)
             from setuptools.command.easy_install import main
             return main(list(argv)+[egg])   # we're done here
-            shutil.rmtree(tmpdir)
+            if egg and os.path.exists(egg):
+                os.unlink(egg)
         if setuptools.__version__ == '0.0.1':
             # tell the user to uninstall obsolete version

File setuptools.txt

 Release Notes/Change History
+ * The ``ez_setup`` module displays the conflicting version of setuptools (and
+   its installation location) when a script requests a version that's not
+   available.
  * Fixed ``AttributeError`` when trying to download a ``setup_requires``
    dependency when a distribution lacks a ``dependency_links`` setting.