[Zope3-dev] More thoughts on packaging

Jim Fulton jim at zope.com
Tue Feb 17 05:08:32 EST 2004


Jeremy Hylton wrote:
> On Fri, 2004-02-13 at 18:16, Fred Drake wrote:
> 
>>Dependency information is just one portion of a package's metadata.  It 
>>should be included along with the other metadata related to the package 
>>itself.  I'd be happy for it to live in the same place as the other package 
>>metadata if we can get that to be in the right place: the package itself.
>>
>>Using setup.py as a container for the package metadata has not worked well 
>>as all, given how many setup.py scripts we maintain.
> 
> 
> I haven't noticed any problems using ZODB3's setup.py to hold metadata. 
> Did you have specific issues in mind?  Perhaps the metadata that is
> currently in setup.py isn't that interesting -- a URL, email address,
> description, and version number.

Somehow, Z3's setup.py is evidence of problems with distutils.
I wish we had separate setup.py scripts for the separate major
components of Zope 3, but somehow, this has been too hard. Instead,
we have this rather complicated monolithic setup.py. Worse, we have
three big monolithic setup.py scripts, for Zope 2, for Zope 3, and for
ZODB that duplicate a good bit of code.

We should have separate setup.py scripts and a controller script that
invokes the separate scripts.  It should, IMO, be possible for the central
script to invoke the others as modules.  This doesn't seem to be possible,
given the way things setup.py scripts are typically written.  It wouldn't
be that big a deal to devise a different *style* of writing setup scripts
so that they could be used by other setup scripts.


> Several people have griped about having to put metadata in a Python
> script.  I think they confusing policy and mechanism.  If a distutils
> command needs metadata to operate, it must be passed to the setup()
> call.  There's no requirement that the data passed to it be stored in a
> script called setup.py or in any Python script.  You could put the
> metadata in a file and write a helper routine that loads metadata to be
> passed to setup.  (I'm not sure what the file format would be.  If I
> have to write it by hand and my choices are Python and XML, I'll stick
> with Python.)

A major problem I have with distutils is that I have to write rather
complex scripts to do somewhat simple things.  I don't
necessarily have a problem with capturing this meta data in Python.

A major problem with the way meta data are captured in setup.py
scripts now, is that the data are expressed as keyword argumments.
As a result, they aren;t accessable.  As mentioned above, some different
conventions for writing setup scripts could go a long way.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list