[Distutils] Manifests

Jeremy Hylton jeremy at alum.mit.edu
Mon Jan 19 09:52:35 EST 2004


On Sun, 2004-01-18 at 18:10, Paul Prescod wrote:
> I propose that if distutils is going to generate a MANIFEST then it 
> should generate it to its temporary cruft directory, not to the source 
> directory. If there is some reason that a user would want to hand-edit 
> the output of this process and use it from then on as INPUT then they 
> can copy it OUT of their distribution to the top-level directory where 
> distutils will treat it from then on as INPUT. Their explicit copying 
> action will indicate that they want to take control of its maintenance 
> henceforth.

Good idea.

> I really don't know why anyone would want to hand-maintain (or use a 
> program to generate) a MANIFEST file when they could just as easily 
> hand-maintain or code-generate the much more flexible manifest template 
> file.

Me neither.  At least in the absence of a better tool than MANIFEST.in.

> (mostly unrelated thought:) I am not clear why distutils separates the 
> concept of manifest template from setup.py. Couldn't you express your 
> complete set of dependencies using globs etc. in the Python code? The 
> whole manifest template seems like just one more file syntax to learn 
> and one more file to maintain.

I think the MANIFEST.in language is a little odd and poorly documented,
but I don't know that it would be any better if I had to write Python
code to achieve the same effect.  Here's a MANIFEST.in for a project I
work on:

include MANIFEST*
include *.txt
include test.py
recursive-include persistent *.h *.c
recursive-include ZODB .c *.xml
recursive-include BTrees *.h .c *.txt
recursive-include BDBStorage *.c
recursive-include ZEO *.xml *.txt
recursive-include zLOG *.xml
recursive-include zdaemon *.xml *.conf *.sh
recursive-include ZConfig *.xml *.conf
include ZConfig/scripts/zconfig
graft Doc
graft Tools
graft ZConfig/doc
global-exclude .cvsignore

I guess that could be improved:

m = Manifest()
m.include("MANIFEST*")
for dir in "ZODB", "BTrees", "BDBStorage", "ZEO", ..., "ZConfig":
    m.recursive_include(dir, ".c", ".xml", ".txt")
for dir in "Doc", "Tools", "ZConfig/doc":
    m.graft(dir)

Jeremy





More information about the Distutils-SIG mailing list