I have a library called \"example\" that I\'m installing into my global site-packages directory. However, I\'d like to be able to install two versions, one for production a
Sure, you can extend distutils with new commands. In your distutil configuration file, add:
[global]
command-packages=foo.bar
this can be in distutils.cfg
in the distutils
package itself, ..pydistutils.cfg
in your home directory (no leading dot on Windows), or setup.cfg
in the current directory.
Then you need a foo.bar package in your Python's site-packages directory.
Then in that package you add the classes implementing your new desired commands, such as stage
, subclassing distutils.cmd -- the docs are weak, but there are plenty of examples since all the existing distutils commands are also built that way.