Pavel Komarov
Pavel Komarov

Reputation: 1246

setuptools not properly excluding tests

My package structure is

package
   |-setup.py
   |-package
   |   |-__init__.py
   |   |-source.py
   |-test
       |-__init__.py
       |-test_source.py

I've got the line packages=find_packages(exclude=['test']) in my call to setup() in my package's setup.py.

If I python3 setup.py sdist bdist_wheel, then navigate in to dist/ and unzip the .tar.gz, I can see the test directory is in the distribution.

I specifically told setup not to do this. Why is that there? I can't figure out how to make it stop.

Upvotes: 3

Views: 1213

Answers (1)

Ry-
Ry-

Reputation: 224904

Test files are included by default:

The following files are included in a source distribution by default:

  • all files matching the pattern test/test*.py

You can use a MANIFEST.in with prune test.

Upvotes: 3

Related Questions