2009/2/26 Martijn Faassen <faas...@startifact.com>:
> On Thu, Feb 26, 2009 at 12:43 PM, Dan Korostelev <nad...@gmail.com> wrote:
>>> (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.
Hey, I didn't try to argue about anything. It was just my subjective
> 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).
Well, I guess that it's my personal desire of control. I'll probably
change my mind about that, as (thinking now), there are really less
things that I don't want to include than things that I want to
include. Also, the plugin mechanism looks interesting to me now. :)
> 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?
Well, that's probably a really big mis-use (I even hope so), but I ran
into really gross slowdown while working on the z3ext project. They
have about 130 eggs (not counting zope 3.4 ones) and each one has the
autoinclude directive and a bunch of egg dependencies. So the
application startup time on my (not so fast though) computer is about
4-5 mins :-/
So, is z3c.autoinclude intended to be used by any egg, including
"feature packages" (like z3c.form) or only for actual applications
(like a ZMI instance)? I'd really like if this topic will be cleared
up in z3c.autoinclude docs.
Also, is there any caching for already processed packages in the
include finder code? If no, I'd probably like to contribute some, if
I'll use z3c.autoinclude. :)
>> 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.
Well, it's quite useful in the "z3ext" case I described above - I
could just turn off the autoincluding and carefully write the includes
in the instance zcml, so get not so crazy startup time.
> 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.
Thanks, I'll take a look at it again.
WBR, Dan Korostelev
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -