[Zope-dev] Proposal: merge zc.configuration's exclude directive into zope.configuration.

Martijn Faassen faassen at startifact.com
Thu Feb 26 07:07:19 EST 2009


Hey,

On Thu, Feb 26, 2009 at 12:43 PM, Dan Korostelev <nadako at gmail.com> wrote:
[snip]
>> (note though that including an extra "meta.zcml" can be avoided if you
>> make use of the z3c.autoinclude library)
>
> Yep, I know about z3c.autoinclude, but I don't like it, as it makes
> things more implicit and it also

Yes, automation makes things more implicit. This is *not* an argument
that can be used against any and all automation. An explicit
includeDependencies directive will include the configure.zcml and
meta.zcml of packages that are dependencies of that package. You make
less mistakes this way (and it's very common to make the mistake to
forget inclusion of some ZCML). It's also pretty rare to want to do
otherwise in my experience (and there's always the exclude directive).

I'd also argue auto-inclusion can actually help guard against
dependency bugs, such as cases where a package tries to include ZCML
it doesn't depend on (and works because some other package makes the
dependency installed).

> slows down startup time for
> applications that uses many eggs.

When claims like that are made, I'd like to see measurements that
demonstrate significant slowdowns during startup. Undoubtedly more
code is excuted than when you write out 'include' directives manually,
but is the slowdown actually measurable?

> I'd like to see an option for
> packages that are using z3c.autoinclude to make autoincluding
> conditional, so those who doesn't like it or needs more control could
> just turn it off.

That's asking for a feature that other packages that *don't* use
autoinclude don't support! You lose control as soon as you include a
package's "configure.zcml". There's no difference with
non-auto-inclusion here; if you include a package's configure.zcml you
get whatever it includes, automatically or using normal zcml include
directives. When auto-inclusion is used all dependencies that use
setup.py are included too. If you want to change that behavior, you
will have to skip importing that package's configure.zcml altogether,
just like in the case where that package does write its include
statements out explicitly.

Anyway, it's fine if you don't want to use auto-inclusion in a
package, but it's not as arbitrarily magic as you are suggesting here.

Regards,

Martijn


More information about the Zope-Dev mailing list