Package data
In most cases you probably won't have to include the package data, but in the cases where you do need data to go with your package, there are a few different options. First, it is important to know which files are included in your package by default:
- Python source files in the package directories recursively
- The
setup.py
andsetup.cfg
files - Tests:
test/test*.py
- All
*.txt
and*.py
files in theexamples
directory - All
*.txt
files in the root directory
So after the defaults, we have the first solution: the package_data
argument to the setup function. The syntax for that is simple enough, a dictionary where the keys are the packages and the values are the patterns to include:
package_data = { 'docs': ['*.rst'], }
The second solution is using a MANIFEST.in
file. This file contains patterns to include, exclude, and more. The include
and exclude
commands use patterns to match. These patterns are glob-style patterns (see the glob
module for documentation: https...