spacepackets-py icon indicating copy to clipboard operation
spacepackets-py copied to clipboard

Tests are installed as package

Open sgaisser opened this issue 1 year ago • 4 comments

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.

sgaisser avatar Dec 11 '24 11:12 sgaisser

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 avatar Dec 11 '24 15:12 robamu

Maybe this is also related to the following line:

[tool.setuptools.packages]
find = {}

i need to check whether we still need this.

robamu avatar Dec 11 '24 15:12 robamu

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 avatar Dec 17 '24 13:12 sgaisser

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

sgaisser avatar Dec 17 '24 13:12 sgaisser

I just checked the venv folder for an install and I do not see the tests anymore, so this should be fine now.

robamu avatar Jun 21 '25 08:06 robamu