[Distutils] python setup.py config glitches

Michiel Jan Laurens de Hoon mdehoon@ims.u-tokyo.ac.jp
Fri Dec 20 00:22:02 2002


Dear pythoneers,

I am using distutils for a scientific plotting package for python. 
Recently I added the configuration part of the installation process to 
setup.py (previously, it was done with a 'make config'). My setup.py now 
looks like

...
from distutils.command.config import config
...

class my_config (config):
     def run (self):
         self.configthis()
         self.configthat()
         ...
     def configthis(self):
         ...
     def configthat(self):
         ...

...
setup(
        ...
        cmdclass = {'config': my_config},
        ...
      )

This all works, except for a few glitches (running Python 2.2.2):

1) On Cygwin, 'python setup.py config' tries to run the cc compiler, 
instead of the gcc compiler. By adding --compiler=cygwin, I can force it 
to use the gcc compiler and everything works, but this should not be 
necessary. When executing 'python setup.py build', I don't need to 
specify --compiler=cygwin, distutils chooses gcc automatically.

2) On Linux, I get an error message from distutils/command/config.py 
line 155:
prog = prog + self.compiler.exe_extension
TypeError: cannot concatenate 'str' and 'NoneType' objects
The problem here is that on Linux, self.compiler.exe_extension is None, 
and python does not allow None to be concatenated with a string. If 
self.compiler.exe_extension would be "", it would work.

3) Running 'python setup.py config' produces a lot of output, such that 
a user would probably miss an error or warning message. Is there a way 
to reduce the amount of output by default? Such that a user who 
simple-mindedly runs 'python setup.py config' sees the important 
information only?

Any help will be appreciated. I apologize if these are known issues.


--Michiel.

-- 
Michiel de Hoon, Assistant Professor
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon