[Distutils] build subcommand order

M.-A. Lemburg mal at egenix.com
Thu Mar 25 14:53:03 EST 2004


Dan Schult wrote:
> I have been using swig 1.3 along with distutils to make a package
> and I'm having trouble with the subcommand order for "build".
> The order is set at the bottom of command.build.py to be:
> build_py
> build_clibs
> build_ext
> build_scripts
> 
> My problem is that swig gets run during build_ext and creates a 
> class definition in a new *.py file.  That python file needs to 
> be moved into the staging area, but build_py doesn't find it 
> because it is created AFTER build_py is run.
> 
> I propose a simple change of the order of the build commands
> so that build_py is last.  

No. That would break other people's scripts.

You can however, have distutils rerun the build_py script by
calling:

build_py = self.distribution.reinitialize('build_py')
build_py.ensure_finalized()
build_py.run()

> It is unlikely that build_py would make any actions that 
> affect the other command, but quite likely (especially given 
> the nature of Swig) that other actions may create
> python files.
> 
> I know one can always use:
> python setup.py build_ext build_py
> but I don't think every person that is packaging
> (or unpackaging) a swig distribution should have to
> document that --or figure it out.
> 
> If there is a better place to submit changes/improvements
> please le me know.
> 
> Thanks for a Great Package!!
> Dan Schult
> 
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Mar 25 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
Python UK 2004, Oxford, UK                                  21 days left
EuroPython 2004, Göteborg, Sweden                           73 days left

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Distutils-SIG mailing list