[Python-checkins] python/nondist/sandbox/setuptools/setuptools dist.py, 1.6, 1.7 __init__.py, 1.6, 1.7

pje@users.sourceforge.net pje at users.sourceforge.net
Wed Jun 15 04:19:46 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11977/setuptools

Modified Files:
	dist.py __init__.py 
Log Message:
Add bootstrap installation support that "hitches a ride" on other packages
being installed via the normal distutils "setup.py install".  Also, don't
repeatedly download the setuptools egg if it's already in the target
location.


Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/dist.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dist.py	12 Jun 2005 15:49:53 -0000	1.6
+++ dist.py	15 Jun 2005 02:19:42 -0000	1.7
@@ -8,6 +8,7 @@
 from setuptools.command.install_lib import install_lib
 from distutils.errors import DistutilsOptionError, DistutilsPlatformError
 from distutils.errors import DistutilsSetupError
+import setuptools
 
 sequence = tuple, list
 
@@ -38,7 +39,6 @@
 
 
 
-
 class Distribution(_Distribution):
     """Distribution with support for features, tests, and package data
 
@@ -348,18 +348,18 @@
         return not not self.requires
 
 
+    def run_commands(self):
+        if setuptools.bootstrap_install_from and 'install' in self.commands:
+            # Bootstrap self-installation of setuptools
+            from easy_install import easy_install
+            cmd = easy_install(
+                self, args=[setuptools.bootstrap_install_from], zip_ok=1
+            )
+            cmd.ensure_finalized()
+            cmd.run()
+            setuptools.bootstrap_install_from = None
 
-
-
-
-
-
-
-
-
-
-
-
+        _Distribution.run_commands(self)
 
 
 

Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/__init__.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- __init__.py	14 Jun 2005 15:48:44 -0000	1.6
+++ __init__.py	15 Jun 2005 02:19:42 -0000	1.7
@@ -15,6 +15,7 @@
     'find_packages'
 ]
 
+bootstrap_install_from = None
 
 def find_packages(where='.'):
     """Return a list all Python packages found within directory 'where'
@@ -38,7 +39,6 @@
 
 
 
-
 def setup(**attrs):
     """Do package setup
 
@@ -56,6 +56,12 @@
 
     command_consumes_arguments = False
 
+    def __init__(self, dist, **kw):
+        # Add support for keyword arguments
+        _Command.__init__(self,dist)
+        for k,v in kw.items():
+            setattr(self,k,v)
+            
     def reinitialize_command(self, command, reinit_subcommands=0, **kw):
         cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
         for k,v in kw.items():
@@ -74,9 +80,3 @@
 
 
 
-
-
-
-
-
-



More information about the Python-checkins mailing list