I have a python project with the following structure:
Clustering (project name) clustering (package) clustering.py and other modules tests (sub-package) test_clustering.py and other such files docs/ bin/
I would like to include the docs directory in my distribution, but I can not seem to do that. Any pointers about how this can be done would be very helpful.
My current setup.py looks like this:
from distutils.core import setup setup(name='Clustering', version='1.0', description='desc', author='A', author_email='[email protected]', packages=['clustering', 'clustering.tests'], requires=['numpy', 'scipy'], scripts=['bin/predict', 'bin/verify'] )
I tried using the package_data option but haven't been successful in including the docs directory in the distribution. Is there some other conventional way of including your docs in the distribution?
Place the files that you want to include in the package directory (in our case, the data has to reside in the roman/ directory). Add the field include_package_data=True in setup.py. Add the field package_data={'': [... patterns for files you want to include, relative to package dir...]} in setup.py .
The most important folder is the dist folder because it contains the distribution files which will be uploaded to PyPI. Its content are presented in figure 12. It contains the . whl file which is the build distribution and also the source distribution .
A MANIFEST.in file consists of commands, one per line, instructing setuptools to add or remove some set of files from the sdist.
You'll need to create a MANIFEST.in file and include some simple instructions on what extra files you want to include (See MANIFEST.in Template)
Example (to include docs dir and all files directly underneath):
include docs/*
or, to include all files in the doc dir (recursively):
recursive-include docs *
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With