"namespace" vs "module" packages (was Re: [Zope3-dev] packaging conventions note)

Jim Fulton jim@zope.com
Sun, 15 Dec 2002 14:30:18 -0500


Casey Duncan wrote:
> ----- Original Message -----
> From: "Jim Fulton" <jim@zope.com>
> To: "Tres Seaver" <tseaver@zope.com>
> Cc: "Guido van Rossum" <guido@python.org>; <stephan.richter@tufts.edu>;
> "Martijn Faassen" <faassen@vet.uu.nl>; <zope3-dev@zope.org>
> Sent: Friday, December 13, 2002 4:44 PM
> Subject: "namespace" vs "module" packages (was Re: [Zope3-dev] packaging
> conventions note)
> [snip]
> 
>>Some packages exist to provide a separate namespace.  The Zope (zope)
>>and ZopeProducts (zopeproducts) packages are like this.  Namespace
>>packages should not export any names from their __init__ modules.  It
>>should be possible to distribute sub-packages or submodules of these
>>independently.  I would even say that namespace packages should allow
>>themselves to be spread over multiple physical locations.  For
>>example, I want the zope and zopeproducts packages to have an __init__
>>that arranges for all zope and zopeproducts directories found on the
>>Python path to be added to the respective package paths,
>>
> 
> This is fine except for the explicit relative import problem. If I yank a
> subpackage out of Zope (lets say it has no other Zope package dependancies)
> and try to use it by itself I'll have to diddle with all the imports before
> it will work, at the least the ones in the unit tests. That's kinda lame.

I failed to communicate. :)

You would not rip a package out of Zope to use it separately. It could
be used outside of the Zope application server, but it would still be in
the Zope package.  For example, suppose you wanted to use zope.security
outside of Zope. You would install a zope package that contained just
the security package, or you might install the zope.security package into
an existing zope package installation, which still lacked zope.app.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org