Lele Gaifax wrote:
Christian Boos ha scritto:
But maybe the "namespace_packages" functionality of setuptools could
help here, suggesting a policy of using a common
"trac.versioncontrol" namespace for all the plugins.
Thanks for the tip.
I implemented this in http://projects.edgewall.com/trac/changeset/2897
Great! I'm still fighting with low-level off-by-one issues in my new
darcs plugin, but I'll surely try to push in the namespace. BTW, why
did you need to declare *two* namespaces on hg plugin (I mean, both
"trac" and "trac.versioncontrol")?
From http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages :
Note, by the way, that your project's source tree must include the
namespace
packages' __init__.py files (and the __init__.py of any parent packages),
in a normal Python package layout. These __init__.py files /must/
contain the line:
...
Also, omitting namespace_packages = ['trac', ...] in setup() produced
warnings.
So, maybe we could drop the "trac" part of the plugin name, to get a
nicer trac.versioncontrol.hg, trac.versioncontrol.darcs and so on, right?
Yes, I now use trac.versioncontrol.hg as the package name for the
TracMercurial plugin.
There's currently only one file in it: 'backend.py', but Trac doesn't
need to bother
about the details within the plugin, only the package name is subject to
the naming convention.
-- Christian
_______________________________________________
Trac-dev mailing list
Trac-dev@lists.edgewall.com
http://lists.edgewall.com/mailman/listinfo/trac-dev