[Grok-dev] five.grok failure - 'Invalid value for', 'handler', 'ImportError: Module zope.app.component.metaconfigure has no global defaultLayer'

Vincent Fretin vincent.fretin at gmail.com
Fri Nov 7 06:01:23 EST 2008


On Fri, Nov 7, 2008 at 10:04 AM,  <sylvain at infrae.com> wrote:
>
> Hello,
>
>> I put five.grok-meta is zcml section too.
>> I didn't know you have to use a newer version of zope.component.
>> I'm lucky, I use the auto compile mo option of zope.i18n. I already
>> use fake eggs and pinned zope.component to 3.4.0.
>> Until now, I only created one grok.View. It works.
>>
>
>  I even use the newest version of zope.component.
>
>> An other solution is to create your plone product as an egg in src/
>> put five.grok in setup.py's install_requires.
>> Add in configure.zcml :
>> <includeDependencies package="." />
>
>   I don't recommend autoinclude; since you should not include the
> meta.zcml of grokcore.view in Zope 2 (unless you want some bugs). It's
> the responsability of each package to say which extension it depends on
> and which configuration to load. If you want to automatically include
> configuration files, do it only on the top level one, not the
> dependencies (I don't known if autoinclude do that).
>
>
>   I recommand in your extension to add a:
>
>  <include package="five.grok" file="meta.zcml" />
>  <include package="five.grok" />
>
>  Best regards,
>
>  Sylvain,
>
>
>
>

I didn't read the code of z3c.autoinclude, but if I well understood,
it does the following:
Read install_requires dependencies in the order, and for each package
it includes meta.zcml, configure.zcml and overrides.zcml if they
exist.
So I suppose in this case,
five.grok in setup.py's install_requires
and in configure.zcml
<includeDependencies package="." />

is equivalent to

<include package="five.grok" file="meta.zcml" />
<include package="five.grok" />

But indeed, if you indicate explicitly grokcore.view in setup.py's
install_requires, it will include meta.zcml, not meta-minimal.zcml.
But I don't include grokcore.view in setup.py, only five.grok, so I
think it's fine.
-- 
Vincent Fretin


More information about the Grok-dev mailing list