How to include docs directory in python distribution

Question:

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?

Asked By: Abhi

||

Answers:

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 *
Answered By: Adam Wagner
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.