pyxem / diffsims

An open-source Python library providing utilities for simulating diffraction
https://diffsims.readthedocs.io
GNU General Public License v3.0
46 stars 26 forks source link

Exclude test suite from source distribution #212

Closed hakonanes closed 6 months ago

hakonanes commented 6 months ago

Currently, tests are included in the source distribution on PyPI (https://pypi.org/project/diffsims/#files). This way, users can run the test suite by doing

> pip install diffsims pytest
> pytest --pyargs diffsims

We may introduce a 125 kB NumPy array file in #205. This will take the distribution size from 946 kB -> 1071 kB.

I don't know, but I doubt there are many people running diffsims' test suite this way. I suggest to exclude the test suite from the source distribution. Interested to hear other's thoughts.

CSSFrancis commented 6 months ago

+1

hakonanes commented 6 months ago

I've taken a U-turn and now suggest to leave the tests in the source distribution. Even though the distribution size increases. Are you still fine with that, @CSSFrancis?

Whether this is a good idea or not is an open question. The general consensus among CPython core developers (https://discuss.python.org/t/should-sdists-include-docs-and-tests/14578/25, top hit on my internet search) seems to be that being able to run tests from the source distribution is a good idea.

hakonanes commented 6 months ago

For future reference, this is one way of excluding tests from the sdist:

CSSFrancis commented 6 months ago

@hakonanes yea, that works for me!