[Distutils] Including tests in source package

Ben Finney ben+python at benfinney.id.au
Sat Aug 21 14:50:29 CEST 2010


Stanisław Pitucha <viraptor at gmail.com> writes:

> If I do:
>
> setup(
>    packages = find_packages(exclude=['tests']),
>    test_suite = "tests",
>    ...
>
> this doesn't package tests anywhere.
[…]

> Essentially I want either tests.py, or tests/__init__.py to be
> distributed in sdist, but not in bdist.

I am using effectively the same as you describe above, but I get the
result you are seeking: the sdist contains the test suite, and the
binary dist does not.

Have a look at Gracie <URL:http://pypi.python.org/pypi/gracie> for an
example that works for me. Perhaps it can help you find what's different
that causes the problem you're seeing.

-- 
 \       “Few things are harder to put up with than the annoyance of a |
  `\                  good example.” —Mark Twain, _Pudd'n'head Wilson_ |
_o__)                                                                  |
Ben Finney



More information about the Distutils-SIG mailing list