Package Organization (was Re: [Zope3-dev] Voting on Schema design)

Jim Fulton jim@zope.com
Mon, 15 Jul 2002 13:39:18 -0400


Barry A. Warsaw wrote:
>>>>>>"JF" == Jim Fulton <jim@zope.com> writes:
...


>     JF> One could argue that the ZODB packages should move into Zope.
> 
> There's one technical glitch which might argue against a Zope
> top-level placeholder.  If you ever want to import some Zope.PackageA
> from a different directory than Zope.PackageB you will be stuck
> because Python won't search two directories for a package's contents.

I don't follow you at all. Any time you want to import Zope.PackageA,
you just:

   import Zope.PackageA

I don't see what Zope.PackageB has to do with it.

> This might be an issue if you've got extensions installed in a
> different location than pure-Python code, or if you want Zope.PackageA
> from your site-packages location, but Zope.PackageB from your Zope
> installation.
> 
> By moving the packages out of the Zope placeholder, you can at least
> control this on a per-package basis as opposed to everything under the
> Zope placeholder package.  That might just be to coarse a granularity.

Well, if you want to sprad a package over multiple physical locations,
that's easy enough to do. We do that in Zope 2 now. Perhaps Python could
provide a mechanism to make this easier. For example, it might be nice if
packages could contain meta-data that would tell Python to search for multiple
package directories along the Python path,

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