Excluding a package from a wheel install

Hi all. I just published mygrad on PyPI and have hit a problem. I would like to exclude my tests-package when user install my project via its wheel file.

My project structure is as follows:

- setup.py
- mygrad/
    |-- __init__.py
    |-- (etc.)
- tests/
    |-- __init__.py
    |-- (etc.)

I included find_packages(exclude=["tests"]) in setup.py, which seems to take care of things when installing mygrad from the tarball, however this does not seem to affect the wheel that gets built. That is, pip-installing this project puts tests in the user’s path despite my instructions to exclude it.

Any advise would be greatly appreciated! I spent all morning reading documentation and stackoverflow.

I was able to exclude tests/ from the wheel by changing the find_packages() call to find_packages(exclude=["tests", "tests.*"]).

Thank you very much for the help, John! I had been trying “tests/", and didn’t think to do "tests.”. That did the trick!