[Distutils] building a shared lib

martin at v.loewis.de martin at v.loewis.de
Mon May 28 19:21:02 CEST 2012

> This works fine, but I would like to allow users to just run python
> setup.py build/install to simplify things for them. I can call
> buildlib.sh from within setup.py, but I am unsure of the right way to do
> it. Should I just call buildlib.sh everytime from setup.py, regardless
> of whether it is with 'build' or 'install'? Can I detect if 'build' is
> being run (whether from 'setup.py build' or 'setup.py install') and only
> run it then? Is there a better way to handle this?

You should create a sub-command of the build command. See commands/build.py,
and find the current list of subcommands of build. Create a new one,
and either monkey-patch build to include this subcommand, or subclass build,
and override it.


More information about the Distutils-SIG mailing list