2011/2/8 Johan Ekh <ekh.jo...@gmail.com>:
> Hi
>
> I'm trying to distribute my python package and would like the distribution
> to also hold the documentation (both html and pdf).
> I can't figure out how the setup.py file should look like. Can anyone point
> me in the right direction?

If you are using setuptools or distribute, you can do the following to
include the documentation in the source distribution (untested):

Create "setup.cfg" with the following content:

[aliases]
build_html = build_sphinx -b html --build-dir build/sphinx/html
build_pdf = build_sphinx -b pdf --build-dir build/sphinx/pdf
sdist = build_html build_pdf sdist

This tells "setuptools" to build both HTML and PDF documentation with
sphinx before, whenever you create a source distribution.  Then add
the following lines to "MANIFEST.in" to tell setuptools to actually
include the built documentation into the source distribution:

graft build/sphinx/html
graft build/sphinx/pdf

Now "python setup.py sdist" should give you an archive which includes
the documentation both in HTML and in PDF format.  But don't do this,
if your package is distributed on the package index, because in this
case it is just wasted space and traffic.  Most users use easy_install
or pip to install packages from the package index, without ever
actually seeing the source distribution itself.  Better upload the
documentation on packages.python.org, so that users can read it online
(and optionally download a PDF file).  Of course, this does not apply,
if you distribute your software in other ways.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to