[Zope3-dev] More thoughts on packaging
Fred Drake
fred at zope.com
Fri Feb 13 17:03:07 EST 2004
On Friday 13 February 2004 03:16 pm, Phillip J. Eby wrote:
> Suppose that we put dependency metadata in package directories as an
> extra file, and then we wrote a 'package.py' script that generates a
> custom 'setup.py' from the metadata, based on an intended target. E.g.
> 'package.py sometarget'.
+1
> The metadata could actually be provided in the form of a Python module
> (e.g. '__setup__.py') that defines any extensions, datafiles, etc., as
> well as "provides" and "requires" keys.
I'm not so sure this belongs in the same file as any Zope-specific
information, but I'm not convinced that any of this is Zope-specific; it
sounds very generally useful for any large collection of packages with
varied dependency relationships.
This is something I'd very much like to see in distutils anyway.
> The 'package.py' script would write a 'setup.py' script that would look
> something like:
>
> execfile('setupstuff/prologue.py')
>
> gatherSetup('src/some/pkg1/__setup__.py')
> gatherSetup('src/other/something/__setup__.py')
>
> # ... etc, etc.
>
> execfile('setupstuff/epilogue.py')
Why two execfile() calls instead of imports? If we're presuming the files
are there, make setupstuff a module or package and use that. So we end up
with something more like:
-------------------------------------------
from setupstuff import setupFromDirectories
setupFromDirectories([
'src/some/pkg1',
'src/other/something',
# ... etc.
])
-------------------------------------------
-Fred
--
Fred L. Drake, Jr. <fred at zope.com>
PythonLabs at Zope Corporation
More information about the Zope3-dev
mailing list