* Michael Bayer <[email protected]> [2012-04-14 22:08]: > 1. Is it OK if I have "__version__" and a few other things in > dogpile/__init__.py of the root project ? this seems to work, as > "dogpile" is always imported first, but the docs at > http://packages.python.org/distribute/setuptools.html#namespace-packages > might suggest otherwise: > > "You must NOT include any other code and data in a namespace package’s > __init__.py. Even though it may appear to work during development, or > when projects are installed as .egg files, it will not work when the > projects are installed using “system” packaging tools – in such cases > the __init__.py files will not be installed, let alone executed."
IIRC, the issue is that it is implementation dependent (read: totally random) *which* dogplie/__init__.py will be used, that of egg "dogpile" or that of egg "dogpile.cache". Thus, unless all your dogpile/__init__.py's are exactly the same (which is easiest when they're empty ;), you can't be sure which one will be used. So, yes, while namespace packages have the huge benefit of actually working (most of the time), they are a huge hack. But until the PEP people get the issue designed properly[1] that's what we're stuck with. Wolfgang [1] http://mail.python.org/pipermail/import-sig/2012-March/000421.html -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
