[Zope3-dev] More thoughts on packaging

Phillip J. Eby pje at telecommunity.com
Tue Feb 17 10:38:36 EST 2004


At 10:17 AM 2/17/04 -0500, Jeremy Hylton wrote:
>On Tue, 2004-02-17 at 10:04, Phillip J. Eby wrote:
> >
> > However, for larger systems, that principle isn't served by putting
> > everything into one setup.py, any more than we put all our Python code 
> into
> > one big module.  We ought to be able to "import" the metadata from modular
> > setup files.
>
>Indeed, there's a tradeoff between centralized configuration and
>repeating the configuration information in more than one place.  If the
>configuration is really simple, I don't mind repeating it, but we're
>probably headed towards non-simple configuration.
>
>One problem with a source tree is that it's hard to import things from
>it.  If the distutils metadata is in some source directory, you need to
>tell setup how to find it.  I don't particularly like a scheme that
>grovels over whatever directories you tell it and find things, because
>you don't have enough explicit control over what goes on.  It's also
>hard to decide how to import something once its found.  Is it part of a
>package?  Should it's containing directory be on the pythonpath?

That's why I said "import" in quotes, to imply "import-like mechanism".  :)

To answer the "how" question, I'd say that control should be explicit; 
either the main setup can explicitly "import" the metadata, or it can 
specify a target item whose dependencies are used to determine what should 
be imported.  Or, we can use the 'package.py' concept whereby you run a 
separate program to generate a setup.py based on a target.

Let's look at a more specific example.  The 'zope' package could contain a 
"setupinfo" that describes what directories under it are 
packages.  Packages with extensions would have setupinfo that describes how 
to build the extensions, and whether the package is dependent on anything 
else.  The top level setup then either says "Import" 'zope' (and therefore 
all its contents) or "import" 'zope.publisher' to package zope.publisher 
and its dependencies.




More information about the Zope3-dev mailing list