At 12:39 PM 8/2/04 -0400, Fred L. Drake, Jr. wrote:
I'd like it to be possible to add additional commands to distutils with modifying distutils itself or the setup.py file included with packages. I don't think this needs to be a particularly risky change.
The use case is to allow additional commands to be added for all distutils setup.py scripts, or to replace commands with site-specific. This could then be used to support alternate bdist_* flavors (either for additional types of packages or alternate implementations for currently supported package types). It could also be used to provide alternate implementations of existing commands to support alternate policies.
Specifically, I propose that distutils should be extended to search for an implementation class across a list of packages instead of only distutils.command, keeping distutils.command as the default entry in the list. Additional packages could be identified using a command line option or configuration data.
FYI, this can be done right now with something like:
import distutils.command import mycommandpackage
distutils.command.__path__.extend(mycommandpackage.__path__)
although that's admittedly kludgy. But it's kludgy in a backwards-compatible way. :)