[Distutils] How to exclude a directory from a module that has tests?

Ionel Cristian Mărieș contact at ionelmc.ro
Fri Nov 13 07:55:14 EST 2015


On Fri, Nov 13, 2015 at 1:50 PM, Nagy László Zsolt <gandalf at shopzeus.com>
wrote:

> The problem is that there is a "test" directory and it is added to the
> source distribution. I want to exclude that. I know that there is an
> "exclude" parameter for find_packages(). But this is not a package. This is
> a single module. How do I exclude a directory then?


​People usually include the tests in their sdist - you might want to do
that too. If you still don't then you can control the contents of sdist via
MANIFEST.in - "test"​ is inlcuded by default afaik so just add a "prune
test" in MANIFEST.in. Still, take note that sdist is not what gets
installed in site-packages, so you should have all your source files in it.
IOW: don't do prune test.



Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20151113/a7fb740b/attachment.html>


More information about the Distutils-SIG mailing list