[Zope-dev] Re: egg issues: adding namespace boilerplate Products / patching testrunner

Philipp von Weitershausen philipp at weitershausen.de
Sun Apr 15 06:48:15 EDT 2007


whit wrote:
> 2 items:
> 
> 1. how does everyone feel about adding the following boilerplate to all 
> occurences of Products/__init__.py to enable the easy creation of 
> Product eggs?
> 
> try:
>     __import__('pkg_resources').declare_namespace(__name__)
> 
> except ImportError:
>     from pkgutil import extend_path
>     __path__ = extend_path(__path__, __name__)

+1

> 2. Could we consider this a defect so it could be added to relavent 
> maintenance branches(provided no one sees any harm in #1. I mainly care 
> about zope 2.9)

Would it really be necessary? Products as eggs already work, as long as 
Zope-2.x/lib/python/Products has been imported first. In a normal Zope 2 
environment, this is typically the case.

> 3. daniel nouri has made a patch for the test runner  to enable a flag 
> optionally add all packages on your path to the test search path.  I 
> consider this a defect in the current test runner that makes working 
> with eggs and 2.9 or 2.10 rather cumbersome.  could we consider adding 
> this or some other solution to this problem?
> 
> http://www.zope.org/Collectors/Zope/2276

Why is this a defect?


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Zope-Dev mailing list