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

Titus Brown titus at caltech.edu
Fri Jan 14 20:08:23 CET 2005

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

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.


More information about the Distutils-SIG mailing list