[Grok-dev] Re: Autoincluding ZCML for package dependencies
Martin Aspeli
optilude at gmx.net
Wed Jan 23 20:13:42 EST 2008
Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martijn Faassen wrote:
>
>> We make this explicit in the ZCML:
>>
>> <autoinclude package="." />
>>
>> This will cause all the ZCML dependencies of your package to be included
>> (all meta.zcml files first, then configure.zcml).
>>
>> If you don't want your package to do auto-inclusion of its dependencies,
>> you shouldn't use it and do manual inclusion. Note that the directive
>> only includes direct dependencies, not indirect ones.
>>
>> I don't see how an entry point is going to make this more explicit. We
>> do this in ZCML as it fits the way inclusions are done in ZCML - it's
>> triggered during ZCML loading just like normal <include> is.
>>
>> The only time auto-inclusion is going to kick in without you directly
>> asking for it is if you include a package's configure.zcml and *it*
>> contains an autoinclude directive. This is little different from
>> includes a package's configure.zcml now, though - you will get its
>> manual includes now.
>
> Sorry, I didn't realize that you were making an explicity gesture in the
> triggering package's ZCML. I'm fine with doing it in ZCML rather than
> in setup.py.
Plone is interested in this too (slugs suck!). Wichert did some
proof-of-concept work with entry points. How else would you do it?
Scanning sys.path?
I don't have time to read up on the code now, but hopefully the solution
should generalise to Plone easily enough.
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Grok-dev
mailing list