[Distutils] Packaging of files, which aren't in the package root folder

David Cournapeau cournape at gmail.com
Mon Dec 14 05:40:34 CET 2009


On Mon, Dec 14, 2009 at 12:12 AM, Lukas Hetzenecker <LuHe at gmx.at> wrote:
> Hello,
>
> thanks for your reply.
> I added these files to MANIFEST.in but they are only in the tarball (generated
> using python setup.py sdist), and not in the installation directory.

Yes, MANIFEST.in does not handle installed files, and is only
concerned with sdist (the MANIFEST.in handling is done in the sdist
command).

There is no easy solution to your problem AFAIK. Since your data files
are outside a package, you have to use data_files argument, but
data_files arguments only install relatively to root or the install
prefix.

You need to write your own command for this, at least with straight
distutils. The easier solution is to put INSTALL and co into a
package, and use package_data:

from distutils.core import setup

if __name__ == '__main__':
    dist = setup(
        name='example',
        packages=['foo'],
        package_data={'foo': ['INSTALL']},
        )

In this case, INSTALL will be installed wherever the package foo is
installed, but this requires INSTALL to be in the foo package.

David


More information about the Distutils-SIG mailing list