[Python-Dev] PEP 376 proposed changes for basic plugins support

P.J. Eby pje at telecommunity.com
Mon Aug 2 23:15:29 CEST 2010


At 09:03 PM 8/2/2010 +0100, Michael Foord wrote:
>Ouch. I really don't want to emulate that system. For installing a
>plugin for a single project the recommended technique is:
>
>      * Unpack the source. It should provide a setup.py.
>      * Run:
>
>        $ python setup.py bdist_egg
>
>      Then you will have a *.egg file. Examine the output of running
>python to find where this was created.
>
>      Once you have the plugin archive, you need to copy it into the
>plugins directory of the project environment

Those instructions are apparently out-of-date; you can actually just 
"easy_install -m" or "pip" the plugin directly to the plugins 
directory, without any additional intervening steps.

(The only reason to create an .egg file for Trac is if you intend to 
distribute to non-developer users who will be told to just drop it in 
the plugins directory.)


>For global plugins it just uses entry points, which is similar to the
>functionality we are suggesting adding...

I believe it's using entry points for both, actually.  It just has an 
(application-specific) filtering mechanism to restrict which entry 
points get loaded.


>Really this sounds *astonishingly* like the system we are proposing. :-)

Which is why I keep pointing out that the code for doing most of it 
is already available in setuptools, distribute, pip, buildout, etc., 
and so (IMO) ought to just get copied into distutils2, the way 
easy_install's package index code was.  ;-)

(Of course, adding some filtering utilities to make it easier for 
apps to do explicit configuration would still be nice.)



More information about the Python-Dev mailing list