<br><br><div class="gmail_quote">On 9 April 2012 15:41, Brian Sutherland <span dir="ltr"><<a href="mailto:brian@vanguardistas.net">brian@vanguardistas.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sun, Apr 08, 2012 at 01:04:37PM -0700, Ross Patterson wrote:<br>
> experimental.broken is working well for me. It greatly aided me in<br>
> getting through a particularly nasty upgrade allowing me to cleanup the<br>
> ZCA cruft left by poorly behaved add-ons. I'd like to proceed with<br>
> adding the core of this to zope.interface and I need the<br>
> developers/maintainers to weigh in.<br>
><br>
> The first and most fundamental matter is changing interface pickles such<br>
> that they can be unpickled into something that can fulfill the minimum<br>
> interface contract and don't break the ZCA. To that end, I'd like to<br>
> add the following to zope.interface.interface:<br>
><br>
> ...<br>
> try:<br>
> from ZODB.broken import find_global<br>
> from ZODB.broken import IBroken<br>
> def find_interface(modulename, globalname,<br>
> Broken=IBroken, type=InterfaceClass):<br>
> """<br>
> Find a global interface, returning a broken interface if it can't be found.<br>
> """<br>
> return find_global(modulename, globalname,<br>
> Broken=IBroken, type=InterfaceClass)<br>
> except ImportError:<br>
> IBroken = Interface<br>
> def find_interface(modulename, globalname,<br>
> Broken=IBroken, type=InterfaceClass):<br>
> """<br>
> Find a global interface, raising ImportError if it can't be found.<br>
> """<br>
> # From pickle.Unpickler.find_class<br>
> __import__(module)<br>
> mod = sys.modules[module]<br>
> klass = getattr(mod, name)<br>
> return klass<br>
> ...<br>
> class InterfaceClass(Element, InterfaceBase, Specification):<br>
> ...<br>
> def __reduce__(self):<br>
> if self is IBroken:<br>
> return self.__name__<br>
> return (find_interface, (modulename, globalname))<br>
> ...<br>
<br>
</div></div>-1<br>
<br>
For a number of reasons, but mainly because you add a test dependency on<br>
the ZODB from zope.interface. I think that zope.interface is such a<br>
fundamental package and the dependency is unacceptable.<br></blockquote><div><br></div><div>It's a soft dependency only, looking at the code sample.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There has lately been a LOT of work done reducing the dependency<br>
structure of zope.* packages. You need a VERY good reason to start<br>
reversing that.</blockquote><div><br></div><div> It doesn't add any more (required) dependencies.</div><div><br></div><div>This is a real issue that is breaking the sites of a lot of real users of zope.interface in a way that is hard to debug and reverse.</div>
<div><br></div><div>Can you think of a better way to get around it? Other than "don't get into the situation" which isn't a valid answer as long as the ZTK ecosystem supports persistent local components.</div>
<div><br></div><div>Martin</div></div>