[Pkg-bazaar-maint] [RFC] Plugin property API
Jelmer Vernooij
jelmer at samba.org
Fri Jul 17 14:37:38 UTC 2009
Robert Collins wrote:
> On Fri, 2009-07-17 at 12:47 +0200, Jelmer Vernooij wrote:
>
>> With the current infrastructure the minimum and maximum version of bzr
>> that is supported will have to be specified in two places: __init__.py
>> (a range of API versions that's supported) and setup.py (a mimimum and
>> maximum bzrlib version). Since this information is updated regularly
>> (pretty much every bzr version) I'd like to specify it only once, in
>> setup.py.
>>
>
> setup.py is often not present in an installed plugin. By often, I mean
> 'I haven't seen one yet'. It is present in the special case of a 'bzr
> branch to install', but not in install-via-packages plugins. And as
> Aaron says a plugin is not required to be a directory, and when its not
> there is no room for setup.py
>
> If you want to make sure that the information is in one place, I suggest
> placing it in e.g. version.py, and import that from setup, and the
> specific plugins __init__.py.
> ...
>
Thanks, that's a good point.
But if we end up doing that (putting this information in a separate file
and importing it where necessary) consistently, would it perhaps make
sense to use such a filename consistently everywhere? Perhaps we could
just allow plugins to provide a "info" object, which could be either a
Python module or an object inside of PLUGINNAME.py that contains the
attributes documented in plugin-api.txt.
Anyway, for now I'll just add a info.py file everywhere as you suggest
and matching code to use it from setup.py (where applicable) and
__init__.py.
Cheers,
Jelmer
More information about the Pkg-bazaar-maint
mailing list