[Grok-dev] Autoincluding ZCML for package dependencies

Ethan Jucovy ejucovy at openplans.org
Wed Jan 23 08:22:30 EST 2008

Thanks for the feedback -- I've made a couple of the changes you suggested.

On Jan 23, 2008 6:05 AM, Jeff Shell <eucci.group at gmail.com> wrote:
> Ack. I see that you're wrapping the calls in sorted()::
>     for dotted_name in sorted(info.get('meta.zcml', [])):
> Do you have any particular reason for doing that?

We had simply assumed there was no stable order to the requirements,
so we sorted() them to guarantee at least some stable order.  From
what I can tell, though, you're right that they remain in the order
specified in setup.py, so I've removed the sorted() call and updated
the tests to indicate the ordering.  (I just made some requirements in
the test packages non-alphabetical, and they seem to be consistently
ordered across a couple of machines, so between that and your findings
I'm at least tentatively convinced.)

> Also - I would beg for some log.debug statements::

Good point... I put it in as you suggested.

> And/or - the docs for autoinclude should include some other tips such
> as how to debug or inspect the choices made via 'debugzope'. Just some
> function that wrapped getting the distribution and returning the
> IncludeFinder results for a particular package/distro.

So something like::

>>> package_includes("APackage")
{'configure.zcml': ['b.c'], 'meta.zcml': ['z3c.autoinclude', 'testdirective']}

(or maybe ``package_includes('a.dottedname')``)?

Incidentally, I'll also start working on some proper documentation soon.

Ethan Jucovy

More information about the Grok-dev mailing list