[Distutils] More minor issues

Rene Liebscher R.Liebscher@gmx.de
Tue Sep 12 06:51:01 2000

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

There are two features which could be very useful.

1) If the install command had a '--force' option,
   which lets install ignore file dates, you could 
   overwrite manipulated installations with the
   original files. 
   Currently if there are changed some files for any
   reason, you have to find and delete them and then
   reinstall the package. (Distutils doesn't overwrite
   newer files.) 
   (Using this feature you could also install an older
    version of the package.)

2) If you are using two or more different python versions
   on your computer, and you want to install a package
   which contains C-compiled extensions, then you have 
   to delete the build directory before you can install
   the package with another version of python or you
   use build with the '--force' option.
   In any case you have to force distutils to rebuild 
   all extensions because they were compiled using a wrong
   version of python.

   If you only build this package once, this may be not a 
   problem, but if you develop a package on your own, you
   have to compile it more often, and then you don't want
   to compile everything new to test it. 
   You could use here different build directories, this is 
   not too much work. But you could forget these options,
   so why doesn't let distutils do it for us.
   We simply have to change the default build directory to
   something like 'build_' + sys.version[0:3] 

   There is attached a patch for it. (build.patch) 

   (Using this, I found 'build_rpm' using a different version
    of python than I have used to start the setup.
    I probably never had spotted it, if both had used the same
    build directory.)

Kind regards

Rene Liebscher
Content-Type: text/plain; charset=us-ascii;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

diff -BurN --exclude=*.pyc --minimal distutils.orig/distutils/command/build.py distutils.patched/distutils/command/build.py
--- distutils.orig/distutils/command/build.py	Sat Jun 24 03:23:37 2000
+++ distutils.patched/distutils/command/build.py	Tue Sep 12 12:05:46 2000
@@ -48,7 +48,7 @@
     def initialize_options (self):
-        self.build_base = 'build'
+        self.build_base = 'build_' + sys.version[0:3]
         # these are decided only after 'build_base' has its final value
         # (unless overridden by the user or client)
         self.build_purelib = None