[Distutils] plugin mechanism for packaging itself?
PJ Eby
pje at telecommunity.com
Wed Jun 13 17:06:57 CEST 2012
On Tue, Jun 12, 2012 at 11:33 PM, Daniel Holth <dholth at gmail.com> wrote:
> I would like to be able to add a command to packaging for all
> packages, not just my own. This is a mechanism that would stay out of
> the way of other packages.
>
> 1. Distribute a submodule of the namespace package 'packaging_hooks'.
> 'packaging_hooks.yourpackage' where 'yourpackage' is the pypi name of
> the package providing the hook
> 2. Include in the submodule a dictionary
> COMMANDS={'command_name':'class name' or class} and __all__ =
> ['COMMANDS', ...]
>
> Packaging calls pkgutil.iter_modules(prefix='packaging_hooks.') to
> import all the submodules of packaging_hooks, looking for COMMANDS=
> and resolving the dotted name of the command class if the value is not
> already the command class.
>
> This would only be a plugin mechanism for packaging itself, not a
> general-purpose replacement for entry_points.
>
Namespace packages are not meant to be a plugin mechanism, and having the
stdlib violate this principle would be setting a horrible precedent.
Please don't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20120613/895bcad8/attachment.html>
More information about the Distutils-SIG
mailing list