[Python-Dev] PEP 376 proposed changes for basic plugins support (original) (raw)

Tarek Ziadé ziade.tarek at gmail.com
Sun Aug 1 22:37:47 CEST 2010


Hello,

Here's a proposal to extend PEP 376 to support a basic plugins feature -- you should read PEP 376 before reading this mail

It's basically Phillip's entry points, but with an activation flag, and a per-user config file.

= adding a PLUGINS file =

A new file called 'PLUGINS' is added to the dist-info directory at install time, and contains a list of plugins for the installed distribution.

The file is a CSV file like the RECORD file, containing one plugin per line. (see the RECORD file for details on the syntax)

A plugin is defined by :

= PLUGINS example =

Here's an example of a PLUGINS file for a 'UnittestPlugins' project that implements 2 unitest2 plugins:

unittest2;plugin;pep8;pep8 checker;1;unittestplugins.pep8 unittest2;plugin;debugger,Cool debugger;1;unittestplugins.debug

= per-user plugins =

A plugin can be activated or disable globally, but a user should be able to configure them differently.

A ini-like plugins.cfg file is added per-user (its location to be defined -- its discussed in another thread) and overrides the state of the installed plugin. It provides a value for each app.type.name plugin.

[plugins] unittest2.plugin.pep8 = 0 distutils2.commands.funkycommand = 0

Notice that the user can have plugins provided by distributions installed in his own per-user site packages.

= Implementation =

I don't want to go into great details here yet, until we get a consensus on the PLUGINS file.

But basically we will add these features in pkgutil:

and in distutils2:

Regards Tarek

-- Tarek Ziadé | http://ziade.org



More information about the Python-Dev mailing list