2 Dec 13:45
Proposal to change the declaration of Envisage plugins in eggs...
From: Martin Chilvers <martin.chilvers@...>
Subject: Proposal to change the declaration of Envisage plugins in eggs...
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-12-02 12:48:20 GMT
Subject: Proposal to change the declaration of Envisage plugins in eggs...
Newsgroups: gmane.comp.python.enthought.devel
Date: 2008-12-02 12:48:20 GMT
G'day,
As some of you may know Envisage ships with a plugin manager that harvests plugins from eggs (the
'EggPluginManager'). The egg plugin manager is very simple(istic!) as it assumes that every plugin
in every egg in the working set (i.e. on sys.path) should be included in your application.
Now, (not coincidentally!), that works just fine for the way that we here at Xype distribute our
applications! We put all of the eggs that are used in an application into what we call an 'egg
basket' and dynamically add the eggs to the working set when the application starts up.
However, this approach does not work nicely if you don't use the egg basket approach and you want to
specify a subset of the plugins on your path to make up your application (which BTW, is how most of
the egg-based test cases and examples work).
The 'EggPluginManager' already supports the notion of an 'include' list, which is simply a list of
the Ids of the plugins that you want to actually use (we should also have an 'exclude' list of
course, but I'll defer that to another test case ;^). Howeever, the problem with the current scheme
is that we don't know the Id of a plugin until we have imported and instantiated it which is quite
smelly if you ask me!
To fix this, I propose changing the way we declare plugin entry points in 'setup.py' modules.
Currently, it looks something like this (taken from the MOTD example):-
entry_points = """
[enthought.envisage.plugins]
motd = acme.motd.motd_plugin:MOTDPlugin
"""
(Continue reading)
RSS Feed