[Distutils] Using namespace packages? READ THIS

Bob Ippolito bob at redivi.com
Sat Mar 18 03:00:54 CET 2006


On Mar 17, 2006, at 5:31 PM, Trent Mick wrote:

> [Phillip J. Eby wrote]
>> I just checked in a fix for the issue with namespace packages in  
>> system
>> package installation scenarios.  This fix unfortunately puts some
>> significant limitations on what you can have in a namespace package
>> __init__.py.
>>
>> Basically, *all* you should have in *every* namespace package  
>> __init__.py is:
>>
>>      __import__('pkg_resources').declare_namespace(__name__)
>
> Pardon my ignorance here. I'd just like to make sure this doesn't  
> affect
> me if I move my stuff to setuptools. Is a "namespace package
> __init__.py" file different than, say, the "__init__.py" used in my
> personal (and mythical) "logging" alternative package:
>
>     flogging/
>         __init__.py    <---- this guy
>         handlers.py
>         ...

Namespace packages support scenarios like zope or twisted where you  
have a bunch of different packages (zope.interfaces, etc.) that share  
a common top-level namespace but are distributed separately.  zope  
would be the namespace package.

Normal packages, like your theoretical flogging package, are not  
normally going to be namespace packages.

-bob



More information about the Distutils-SIG mailing list