Without any additional information, the
sdist command puts a
minimal set of files into the source distribution:
sdistcommand processes this template and generates a manifest file, MANIFEST. (If you prefer, you can skip the manifest template and generate the manifest yourself: it just lists one file per line.)
The manifest template has one command per line, where each command specifies a set of files to include or exclude from the source distribution. For an example, again we turn to the Distutils' own manifest template:
include *.txt recursive-include examples *.txt *.py prune examples/sample?/build
*.txt, all files anywhere under the examples directory matching
*.py, and exclude all directories matching
examples/sample?/build. There are several other commands available in the manifest template mini-language; see section 9.4.
The order of commands in the manifest template very much matters: initially, we have the list of default files as described above, and each command in the template adds to or removes from that list of files. When we have fully processed the manifest template, we have our complete list of files. This list is written to the manifest for future reference, and then used to build the source distribution archive(s).
Following the Distutils' own manifest template, let's trace how the
sdist command will build the list of files to include in the
Distutils source distribution:
prunecommand in the manifest template comes after the two
Just like in the setup script, file and directory names in the manifest template should always be slash-separated; the Distutils will take care of converting them to the standard representation on your platform. That way, the manifest template is portable across operating systems.