plone buildout and Products namespace

Leonardo Rochael leo at enfoldsystems.com
Thu Oct 18 03:14:07 UTC 2007


Hi Martin


Martin Aspeli wrote:
> 
> [Leo suggests creating "Products" namespace packages for all Products
> producing parts in a buildout]
> 
> Thinking about this some more - does it really matter that the parent 
> directory for everything on the Product-path is "Products" with a 
> capital P and has an __init__.py that declares a namespace package?
> 
> [... snip detailed analysys of why "Products" namespace packages don't
> matter for Zope ...]
> 
> I may be wrong though. But if I'm not, then I'm -1 on your proposal, 
> since it'd be changing stuff that's documented and which people are 
> using right now in a way that makes it more confusing (multiple 
> plone.recipe.distro parts would use the same directory, adding 
> __init__.py makes this look like a package when it's not) and 
> inconsistent (everything else in the buildout uses lowercase directory 
> names) for no actual beenfit.
> 
> 

Your analysis is correct as far as Zope is concerned, and indeed my
suggested change brings no benefit to a buildout configuration or to the
operation of the Zope instance itself. The primary benefit of my suggestion
is for tools that analyze python code to, for instance, try to catch import
errors or do code completion.

These tools do not try to run a Zope instance and as such do not understand
that, for instance, the CMFCore" package is in effect under a "Products"
package and so they complain when they see something like "from
Products.CMFCore.utils import getToolByName".

I am not suggesting that all recipes should put their products under a
single Products directory. Rather, each recipe that creates non-egg Products
would be responsible for creating it's own "Products" namespace package and
putting the products in there.

Meanwhile, the zope2instance part of such a buildout should be configured to
list all "Products" namespaces of all the Products-generating recipes into
zope.conf.

This change seems trivial to implement because both recipes that deal with
classic products in a plone3_buildout template actually delegate into
plone.recipe.distros for their work.

Again, the benefit is not for Plone or Zope, but for python oriented tools
that are not zope-specific, so they can understand Zope Products import
statements.

Cheers,  Leo

-- 
View this message in context: http://www.nabble.com/plone-buildout-and-Products-namespace-tf4642882s20094.html#a13267306
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list