[Zope3-dev] Re: More thoughts on packaging
Jeremy Hylton
jeremy at zope.com
Mon Feb 16 22:01:28 EST 2004
On Mon, 2004-02-16 at 20:28, Richard Jones wrote:
> It has a data_files option (see section 3.5 of the distutils manual)
> which lists data files to install in subdirs of the install prefix. So
> in Roundup, I specify things like:
>
> ('share/roundup/cgi-bin', ['cgi-bin/roundup.cgi'])
>
> and
>
> ('man/man1', ['doc/roundup-admin.1',
> 'doc/roundup-mailgw.1', 'doc/roundup-server.1'])
>
> Or were you thinking of something else?
I was thinking of something else. Zope makes widespread use of data
files stored in Python packages. It is probably the most convenient way
to associate a data file with code; you can access it by computing paths
relative to __file__ or __path__. The recursive-include directive from
ZODB's MANIFEST.in should illustrate the point:
recursive-include src *.h *.c *.xml *.txt *.sh *.conf *.bat
The first two are C extension source, of course. The rest are various
kinds of data and scripts that are supposed to be installed with the
rest of the package in site-packages (or wherever else you choose to
install the code). It takes at least 30 or 40 lines of code in a
setup.py to get those files installed where they belong.
The problem is easy to solve. We just need some way to specify data
files that are associated with packages. For Zope's use, I expect a
list of extensions that should be installed would suffice.
Jeremy
More information about the Zope3-dev
mailing list