Hi folks, I've been using distutils to package Python extensions for two packages, and I keep stumbling across two different issues with 'setup.py' usage. The first is the behavior of 'clean': --help-commands says clean clean up output of 'build' command which (to me) meant that 'python setup.py clean' would remove my build directory. Instead, it means 'remove temporary files but leave stuff under build/lib'. Apparently 'clean --all' is what you need to use to get this behavior. I'd suggest changing the --help-commands string to say clean clean up temporary files from 'build' command or some such. Alternatively, make '--all' the default behavior, and have '--temp-only' retain lib.* files. (My expected behavior of 'clean' comes from C Makefiles, where 'clean' means 'remove all object files and force recompilation.) -- The second issue is with the default --help behavior. I find that 'python setup.py --help' returns information that's not very useful to package *installers*, who usually only care about 'build' and 'install'. I'd strongly recommend having '--help' return more up-front information about build, install, and clean. Perhaps something like """ Commonly-used commands: (see --help-commands for more information) build build everything needed to install install install everything from build directory clean clean up output of 'build' command """ in front of the current output. Thanks for bearing with my whining ;). If a set of changes can be agreed upon, I'd be happy to make the changes & submit patches. cheers, --titus
Titus Brown wrote:
Hi folks,
I've been using distutils to package Python extensions for two packages, and I keep stumbling across two different issues with 'setup.py' usage.
The first is the behavior of 'clean': --help-commands says
clean clean up output of 'build' command
which (to me) meant that 'python setup.py clean' would remove my build directory. Instead, it means 'remove temporary files but leave stuff under build/lib'. Apparently 'clean --all' is what you need to use to get this behavior.
I'd suggest changing the --help-commands string to say
clean clean up temporary files from 'build' command
or some such. Alternatively, make '--all' the default behavior, and have '--temp-only' retain lib.* files.
+1 on the help string change. +0 on making --all the default.
(My expected behavior of 'clean' comes from C Makefiles, where 'clean' means 'remove all object files and force recompilation.)
--
The second issue is with the default --help behavior. I find that 'python setup.py --help' returns information that's not very useful to package *installers*, who usually only care about 'build' and 'install'. I'd strongly recommend having '--help' return more up-front information about build, install, and clean. Perhaps something like
""" Commonly-used commands: (see --help-commands for more information)
build build everything needed to install install install everything from build directory clean clean up output of 'build' command """
in front of the current output.
I'd suggest adding a few common examples to the --help output.
Thanks for bearing with my whining ;). If a set of changes can be agreed upon, I'd be happy to make the changes & submit patches.
Please post the patches to SourceForge. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 10 2005)
Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
-> Please post the patches to SourceForge. patch at http://issola.caltech.edu/~t/transfer/python-distutils-help-patch patch 1104111 on SF w/patch file attached. --- % python setup.py --help Common commands: (see '--help-commands' for more) setup.py build will build the package underneath 'build/' setup.py install will install the package Global options: ... --- and --- % python setup.py --help-commands Standard commands: ... clean clean up temporary files from 'build' command ... --- Also note that on http://www.python.org/sigs/distutils-sig/cvs.html the CVS hostname needs to be changed to 'cvs.sf.net' from 'cvs.python.sf.net' to accomodate changes in SF... cheers, --titus
On Monday 17 January 2005 14:53, Titus Brown wrote:
Also note that on
http://www.python.org/sigs/distutils-sig/cvs.html
the CVS hostname needs to be changed to 'cvs.sf.net' from 'cvs.python.sf.net' to accomodate changes in SF...
Done; thanks for pointing this out! -Fred -- Fred L. Drake, Jr. <fdrake at acm.org>
participants (3)
-
Fred L. Drake, Jr.
-
M.-A. Lemburg
-
Titus Brown