Do python projects need a MANIFEST.in, and what should be in it?
The "Python Distribute" guide (was at python-distribute.org, but that registration has lapsed) tells me to include
doc/txt files and
.py files are excluded in
The sourcedist documentation tells me only sdist uses
MANIFEST.in and only includes file you specify and to include
.py files. It also tells me to use:
python setup.py sdist --manifest-only to generate a
MANIFEST, but python tells me this doesn't exist
I appreciate these are from different versions of python and the distribution system is in a complete mess, but assuming I am using python 3 and
setuptools (the new one that includes distribute but now called setuptools, not the old setuptools that was deprecated for distribute tools only to be brought back into distribute and distribute renamed to setuptools.....)
and I'm following the 'standard' folder structure and
- Do I need a
- What should be in it ?
- When will all these different package systems and methods be made into one single simple process ?
Re: "Do I need a MANIFEST.in?
No, you do not have to use
setuptools are including in source distribution package all the files mentioned in
setup.py - modules, package python files,
test/test*.py. If this is all you want to have in distribution package, you do not have to use
If you want to manipulate (add or remove) default files to include, you have to use
Re: What should be in it?
The procedure is simple:
Make sure, in your
setup.pyyou include (by means of
setuparguments) all the files you feel important for the program to run (modules, packages, scripts ...)
Clarify, if there are some files to add or some files to exclude. If neither is needed, then there is no need for using
MANIFEST.inis needed, create it. Usually, you add there
README.rstif you do not use
docsfiles and possibly some data files for test suite, if necessary.
include README.rst include COPYING.txt
To test it, run
python setup.py sdist, and examine the tarball created under
When will all these different package systems ...
Comparing the situation today and 2 years ago - the situation is much much better -
setuptools is the way to go. You can ignore the fact,
distutils is a bit broken and is low level base for
setuptools shall take care of hiding these things from you.
EDIT : Last few projects I use
pbr for building distribution packages with three line
setup.py and rest being in
requirements.txt. No need to care about
MANIFEST.in and other strange stuff. Even though the package would deserve a bit more documentation. See http://docs.openstack.org/developer/pbr/
★ Back to homepage or read more recommendations: