[Python-Dev] Packaging and setuptools compatibility

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Jan 24 22:58:52 CET 2012


On Jan 24, 2012, at 12:54 PM, Alexis Métaireau wrote:

> I'm wondering if we should support that (a way to have plugins) in the new packaging thing, or not. If not, this mean we should come with another solution to support this outside of packaging (may be in distribute). If yes, then we should design it, and probably make it a sub-part of packaging.

First, my interest: Twisted has its own plugin system.  I would like this to continue to work in the future.

I do not believe that packaging should support plugins directly.  Run-time metadata is not the packaging system's job.  However, the packaging system does need to provide some guarantees about how to install and update data at installation (and post-installation time) so that databases of plugin metadata may be kept up to date.  Basically, packaging's job is constructing explicitly declared parallels between your development environment and your deployment environment.

Some such databases are outside of Python entirely (for example, you might think of /etc/init.d as such a database), so even if you don't care about the future of Twisted's weirdo plugin system, it would be nice for this to be supported.

In other words, packaging should have a meta-plugin system: a way for a plugin system to register itself and provide an API for things to install their metadata, and a way to query the packaging module about the way that a Python package is installed so that it can put things near to it in an appropriate way.  (Keep in mind that "near to it" may mean in a filesystem directory, or a zip file, or stuffed inside a bundle or executable.)

In my design of Twisted's plugin system, we used PEP 302 as this sort of meta-standard, and (modulo certain bugs in easy_install and pip, most of which are apparently getting fixed in pip pretty soon) it worked out reasonably well.  The big missing pieces are post-install and post-uninstall hooks.  If we had those, translating to "native" packages for Twisted (and for things that use it) could be made totally automatic.

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120124/eee8592d/attachment.html>


More information about the Python-Dev mailing list