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 MANIFEST.in
file
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 setup.py
file,
- Do I need a
MANIFEST.in
? - 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
MANIFEST.in
. Both,distutils
andsetuptools
are including in source distribution package all the files mentioned insetup.py
- modules, package python files,README.txt
andtest/test*.py
. If this is all you want to have in distribution package, you do not have to useMANIFEST.in
.If you want to manipulate (add or remove) default files to include, you have to use
MANIFEST.in
.Re: What should be in it?
The procedure is simple:
Make sure, in your
setup.py
you include (by means ofsetup
arguments) 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.in
.If
MANIFEST.in
is needed, create it. Usually, you add theretests*/*.py
files,README.rst
if you do not useREADME.txt
,docs
files and possibly some data files for test suite, if necessary.For example:
To test it, run
python setup.py sdist
, and examine the tarball created underdist/
.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 forsetuptools
assetuptools
shall take care of hiding these things from you.EDIT: Last few projects I use
pbr
for building distribution packages with three linesetup.py
and rest being insetup.cfg
andrequirements.txt
. No need to care aboutMANIFEST.in
and other strange stuff. Even though the package would deserve a bit more documentation. See http://docs.openstack.org/developer/pbr/Old question, new answer:
No, you don't need
MANIFEST.in
. However, to getsetuptools
to do what you (usually) mean, you do need to use thesetuptools_scm
, which takes the role ofMANIFEST.in
in 2 key places:sdist
command (where all relevant files is defined as "all files under source control")include_package_data
to include package data as part of thebuild
orbdist_wheel
. (again: files under source control)The historical understanding of
MANIFEST.in
is: when you don't have a source control system, you need some other mechanism to distinguish between "source files" and "files that happen to be in your working directory". However, your project is under source control (right??) so there's no need forMANIFEST.in
. More info in this article.