Specifying Additional Files With A Manifest

By default, Distutils will include the following files in your release package:

  • README.txt
  • setup.py
  • The .py files needed by the multi-file modules listed in the packages parameter
  • The individual .py files listed in the py_modules parameter

That will cover all the files in the httplib2 project. But for the chardet project, we also want to include the COPYING.txt license file and the entire docs/ directory that contains images and HTML files. To tell Distutils to include these additional files and directories when it builds the chardet release package, you need a manifest file.

A manifest file is a text file called MANIFEST.in. Place it in the project’s root directory, next to README.txt and setup.py. Manifest files are not Python scripts; they are text files that contain a series of “commands” in a Distutils-defined format. Manifest commands allow you to include or exclude specific files and directories.

This is the entire manifest file for the chardet project:

Get hands-on with 1400+ tech skills courses.