[Distutils] 'clean' and '--help' suggestions.

M.-A. Lemburg mal at egenix.com
Mon Jan 17 10:29:51 CET 2005

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

> 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.

Marc-Andre Lemburg

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 ! ::::

More information about the Distutils-SIG mailing list