how to add command line flags to distutils setup script?

skip at skip at
Tue Dec 9 01:59:52 CET 2008

Suppose I have a script which imports distutils.core.setup.  Is
there some way to, for example, add a command line flag to the build command
so that I can run it like

    python build --frob=True

?  I see that the setup function takes an options parameter but the
distutils.core.setup doc says little other than that it is a string and
"default options for the setup script".  There is also a script_args
parameter, but the docs are similarly mum about what exactly it's used for.
A posting by Greg Ward announcing it in Aug 2000 says script_args is a sub
for sys.argv[1:].

Pointers to other documentation or tutorials on the topic cheerfully


Skip Montanaro - skip at -

More information about the Python-list mailing list