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 are installed as package #94

Open
sgaisser opened this issue Dec 11, 2024 · 4 comments
Open

Tests are installed as package #94

sgaisser opened this issue Dec 11, 2024 · 4 comments

Comments

@sgaisser
Copy link

Currently, the tests are installed as own package and show up in the python environment if the package is installed with pip.

Maybe add

[tool.setuptools.packages.find]
exclude = ["docs", "tests*"]

to the pyrpoject.toml. Idk if this works.

@robamu
Copy link
Contributor

robamu commented Dec 11, 2024

Hmm, is this a common solution? is it a large issue that the tests are installed as well?

https://packaging.python.org/en/latest/tutorials/packaging-projects/

does not mention any special handling for test files.

@robamu
Copy link
Contributor

robamu commented Dec 11, 2024

Maybe this is also related to the following line:

[tool.setuptools.packages]
find = {}

i need to check whether we still need this.

@sgaisser
Copy link
Author

Hmm, is this a common solution? is it a large issue that the tests are installed as well?

https://packaging.python.org/en/latest/tutorials/packaging-projects/

does not mention any special handling for test files.

I think, test might not have a __init__.py file in other packages. If so, they are detected as package. I saw this in other projects:

[tool.setuptools]
packages = ["package_name_1", "package_name_2"]

@sgaisser
Copy link
Author

sgaisser commented Dec 17, 2024

Ah maybe this is even fixed by moving to src/ layout. I think the __init__.py in the src folder is not required.

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

No branches or pull requests

2 participants