Including test and docs in distribution
Hey all, I have a single module I distribute and I would *like* to include the tests (a package) and docs (sphinx generated - single directory) in the distribution - but not have them "installed" by setup.py. Is this possible with either distutils or distribute? Anyone able to suggest the right magic incantation for the setup.py? (Or a better approach - I really don't want to make my 600 line single module a package though.) All the best, Michael Foord -- http://www.voidspace.org.uk
On Tue, Jun 22, 2010 at 11:04 AM, Michael Foord
Hey all,
I have a single module I distribute and I would *like* to include the tests (a package) and docs (sphinx generated - single directory) in the distribution - but not have them "installed" by setup.py.
By distribution, you mean the tarball generated by sdist ? In that case, just use the MANIFEST.in, and ensure the doc is build when doing a sdist. You could for example use paver to do that. cheers, David
On Tue, Jun 22, 2010 at 12:34:46PM +0900, David Cournapeau wrote:
On Tue, Jun 22, 2010 at 11:04 AM, Michael Foord
wrote: Hey all,
I have a single module I distribute and I would *like* to include the tests (a package) and docs (sphinx generated - single directory) in the distribution - but not have them "installed" by setup.py.
By distribution, you mean the tarball generated by sdist ? In that case, just use the MANIFEST.in, and ensure the doc is build when doing a sdist. You could for example use paver to do that.
MANIFEST.in is indeed the right answer. If it's simply a single module package it's easy and low-maintenance to do by hand, e.g.: include tests/*.py recursive-include docs/ See http://docs.python.org/distutils/commandref.html#creating-a-source-distribut... for details of MANIFEST.in -- Debian GNU/Linux -- The Power of Freedom www.debian.org | www.gnu.org | www.kernel.org
On 22 June 2010 08:39, Floris Bruynooghe
On Tue, Jun 22, 2010 at 12:34:46PM +0900, David Cournapeau wrote:
On Tue, Jun 22, 2010 at 11:04 AM, Michael Foord
wrote: Hey all,
I have a single module I distribute and I would *like* to include the tests (a package) and docs (sphinx generated - single directory) in the distribution - but not have them "installed" by setup.py.
By distribution, you mean the tarball generated by sdist ? In that case, just use the MANIFEST.in, and ensure the doc is build when doing a sdist. You could for example use paver to do that.
MANIFEST.in is indeed the right answer. If it's simply a single module package it's easy and low-maintenance to do by hand, e.g.:
include tests/*.py recursive-include docs/
See http://docs.python.org/distutils/commandref.html#creating-a-source-distribut... details of MANIFEST.in
That's exactly what I need. Thanks very much for your help. All the best, Michael Foord
-- Debian GNU/Linux -- The Power of Freedom www.debian.org | www.gnu.org | www.kernel.org
participants (3)
-
David Cournapeau
-
Floris Bruynooghe
-
Michael Foord