[PATCH] distutils: Add MANIFEST.in file to include all files in 'python setup.py sdist'

Matt Mackall mpm at selenic.com
Wed Jun 1 17:35:33 CDT 2011


On Thu, 2011-06-02 at 08:16 +1000, Thorne, Stephen wrote:
> On Thu, Jun 2, 2011 at 2:20 AM, Matt Mackall <mpm at selenic.com> wrote:
> > On Wed, 2011-06-01 at 17:34 +1000, Stephen Thorne wrote:
> >> # HG changeset patch
> >> # User Stephen Thorne <stephen at thorne.id.au>
> >> # Date 1306913635 -36000
> >> # Node ID 273241bc44612434b1c67851dfb2bae437c75e62
> >> # Parent  bd34a027f3edad33e71c02def67eb446473b6cf4
> >> distutils: Add MANIFEST.in file to include all files in 'python setup.py sdist'
> >>
> >> When running 'python setup.py sdist' many files were omitted from the resulting
> >> tarball that are required for a complete build, including the .h file for the
> >> inotify extension.
> >
> > This is already automated. See 'make MANIFEST'.
> >
> > Why isn't this instead automated in setup.py? Because distutils is an
> > under-documented, poorly maintained, ill-suited.. you get the idea. It's
> > primary use to us is supplying compiler options on multiple platforms.
> 
> Okay, so I've had a look at the sdist that is created when using the
> MANIFEST that is created from 'make MANIFEST', and it omits things
> that are required for a successful build, such as mercurial.pure (for
> pure python implementations of c modules) and mercurial/util.h (for
> successful build of c modules.

It does?

$ rm MANIFEST
$ make MANIFEST > /dev/null
$ grep util.h MANIFEST
mercurial/util.h
$ grep pure MANIFEST
mercurial/pure/base85.py
mercurial/pure/bdiff.py
mercurial/pure/diffhelpers.py
mercurial/pure/mpatch.py
mercurial/pure/osutil.py
mercurial/pure/parsers.py

> I wrote the MANIFEST.in patch to achieve a certain goal: make the
> sdist useful for building mercurial, this is required for tools like
> bdist_rpm to function correctly.
> 
> I have had a play with 'make MANIFEST', and it seems that there is no
> difference in the files included in the resulting .tar.gz from an
> sdist and a bdist between having the MANIFEST present and having it
> absent. What does the 'make MANIFEST' achieve?

Well.. it builds the MANIFEST that distutils wants. In particular, it
builds it -directly- from Mercurial's own version-controlled manifest,
rather than relying on manual maintenance of a set of shell globs.

Though, as Mads has pointed out, distutils spuriously and silently
deletes MANIFEST in some versions and then helpfully generates its own
broken version.

If your goal is to build an RPM, you might want to use contrib/buildrpm
instead.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list