Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests directory incorrectly included in package installation #478

Closed
jlumpe opened this issue Mar 1, 2024 · 5 comments
Closed

Tests directory incorrectly included in package installation #478

jlumpe opened this issue Mar 1, 2024 · 5 comments

Comments

@jlumpe
Copy link

jlumpe commented Mar 1, 2024

The tests/ subdirectory is included in the package distribution and is installed to the user's site-packages directory:

$ pip show -f peppy
Name: peppy
Version: 0.40.1
Summary: A python-based project metadata manager for portable encapsulated projects
Home-page: https://github.com/pepkit/peppy/
Author: Michal Stolarczyk, Nathan Sheffield, Vince Reuter, Andre Rendeiro, Oleksandr Khoroshevskyi
Author-email:
License: BSD2
Location: /home/jared/tmp/peppy-env/lib/python3.10/site-packages
Requires: numpy, pandas, pyyaml, rich, ubiquerg
Required-by:
Files:
  peppy-0.40.1.dist-info/INSTALLER
  peppy-0.40.1.dist-info/LICENSE.txt
  peppy-0.40.1.dist-info/METADATA
  peppy-0.40.1.dist-info/RECORD
  peppy-0.40.1.dist-info/REQUESTED
  peppy-0.40.1.dist-info/WHEEL
  peppy-0.40.1.dist-info/top_level.txt
  peppy/__init__.py
  peppy/__pycache__/__init__.cpython-310.pyc
  peppy/__pycache__/_version.cpython-310.pyc
  peppy/__pycache__/const.cpython-310.pyc
  peppy/__pycache__/exceptions.cpython-310.pyc
  peppy/__pycache__/parsers.cpython-310.pyc
  peppy/__pycache__/project.cpython-310.pyc
  peppy/__pycache__/sample.cpython-310.pyc
  peppy/__pycache__/simple_attr_map.cpython-310.pyc
  peppy/__pycache__/utils.cpython-310.pyc
  peppy/_version.py
  peppy/const.py
  peppy/exceptions.py
  peppy/parsers.py
  peppy/project.py
  peppy/sample.py
  peppy/simple_attr_map.py
  peppy/utils.py
  tests/__init__.py
  tests/__pycache__/__init__.cpython-310.pyc
  tests/__pycache__/conftest.cpython-310.pyc
  tests/__pycache__/test_Project.cpython-310.pyc
  tests/conftest.py
  tests/smoketests/__init__.py
  tests/smoketests/__pycache__/__init__.cpython-310.pyc
  tests/smoketests/__pycache__/test_Project.cpython-310.pyc
  tests/smoketests/__pycache__/test_Sample.cpython-310.pyc
  tests/smoketests/test_Project.py
  tests/smoketests/test_Sample.py
  tests/test_Project.py
@nsheff
Copy link
Contributor

nsheff commented Mar 1, 2024

Thanks for raising this. I agree that's strange.

@stolarczyk did you have a reason for adding the /tests folder to the MANIFEST.in?

recursive-include tests *.py

@stolarczyk
Copy link
Member

stolarczyk commented Mar 3, 2024

I may have had a reason initially, but it's probably no longer valid. I second the suggestion for removal.

@jlumpe
Copy link
Author

jlumpe commented Mar 13, 2024

I don't think this is just a question of MANIFEST.in, as these are modules and not just data files. Pretty sure the issue is setup.py L43, setuptools.find_packages() will include tests/ as it contains an __init__.py. I believe setuptools has default behavior to exclude common directories like tests/, docs/ etc from package discovery but only if you don't provide values for any of the package discovery options. Solution would be to remove that line entirely or change to find_packages(exclude=['tests', 'tests.*']).

@nsheff
Copy link
Contributor

nsheff commented Mar 13, 2024

or, even better, just use packages=['peppy'], since this will only ever hold a single package.

Thanks for pointing that out.

@jlumpe
Copy link
Author

jlumpe commented Mar 14, 2024

@nsheff or packages=['peppy', 'peppy.*'] if you have any subpackages (not sure why setuptools doesn't provide an easy way to combine those).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants