[Grok-dev] Problem with z3c.autoinclude of eggs in the Products namespace
vincent.fretin at gmail.com
Mon Nov 24 07:55:17 EST 2008
On Sat, Nov 22, 2008 at 8:16 PM, Ethan Jucovy <ejucovy at openplans.org> wrote:
> Hey Vincent,
> I don't know much about buildout or the inner workings of Five, so this is a
> bit of a stab in the dark, but it sounds to me like package inclusion order
> is the most likely culprit here. As a quick sanity check, could you try
> including the package directly, and see whether the problem remains the
> same? In src/myproject.policy/myproject/policy/configure.zcml, just change
> <includeDependencies package="." />
> <include package="Products.mypolicy" />
> If my guess is correct that package inclusion order is somehow the cause,
> then this shouldn't change any of the symptoms you're seeing. That'll at
> least be useful information to start debugging the problem.
> Actually, though, do you need to explicitly include Products.mypolicy's ZCML
> (whether directly or indirectly through z3c.autoinclude) at all? Shouldn't
> the <five:loadProducts /> directive in your site.zcml load
> Products.mypolicy's ZCML files for you, before myproject.policy's ZCML is
> even loaded?
You absolutly right. Here I don't use the autoinclude fonctionnality
to include Products.* eggs. I know it's already automatic.
It's just that myproject.policy depends on Products.myproject and
other eggs not in Products namespace.
I want that when I install the myproject.policy egg, all dependencies
are installed as well.
And I want to use the autoinclude fonctionnality for dependencies not
in Products namespace.
I did some tests, including zcml in different order. It's always working. :-S
I think I found the problem, it's my fault.
It's not working when I don't put Products.myproject in eggs in buildout.cfg
The <include package="Products.myproject" /> complains about it, it
don't find the package.
ConfigurationError: ('Invalid value for', 'package', 'ImportError:
Module Products has no global myproject')
With <includeDependencies package="." />, it don't complains when it
can't find the package, it silently continues.
Why this choice by default? Is it Normal? For me it's a bug.
Thanks Ethan, you have open my eyes on this problem.
More information about the Grok-dev