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

flit-core is installed alongside with tests #403

Closed
befeleme opened this issue Mar 31, 2021 · 5 comments
Closed

flit-core is installed alongside with tests #403

befeleme opened this issue Mar 31, 2021 · 5 comments
Milestone

Comments

@befeleme
Copy link

Hello,
When tackling the update of flit in Fedora I came across a difference in installation of flit and flit-core - the latter is installed with tests/. I wonder if this is by design, as usually packages tend not to bring tests (as in this case, flit).
Would you consider a change in installation process for flit-core?

@takluyver
Copy link
Member

I'm interested you say packages tend not to do this, because I thought that a lot of packages do - e.g. numpy, matplotlib, Jupyter packages all include their tests in the package that gets installed. Maybe it's more common in the scientific Python world than beyond that.

There's no particular reason flit & flit-core differ; I go back & forth on which way I prefer, and flit has caught both sides of that.

@befeleme
Copy link
Author

I checked ~10 most popular packages from PyPI stats where none of them gets installed with tests. Those you mention, however are.
As from packager point of view, the tests are an important part of build, but kinda lose their importance in the resulting package - the package size is reduced without them and it's not that likely final users would want to test the library.
There is no problem in handling this downstream, it's just always more sustainable to get the "ideal" state from the upstream developers, hence my question.

@eli-schwartz
Copy link

I've seen some packages where the tests were just wired badly, and didn't run at all except as part of the installed wheel. But yeah, generally the point of tests is to run them as part of the process of making final distribution artifacts. Sadly there's no way for pip to automatically do this for you, but meta-package managers generally do.

Anyway... looks like the wheel file would drop from 48K to 24K if the tests are removed (324K to 92K for the extracted directory), so halving the network usage seems useful.

At any rate, this doesn't exactly provide a test entry point, so users wanting to test this would probably have to do something like:

$ python
>>> import flit_core.tests, os.path, pytest
>>> pytest.main([os.path.dirname(flit_core.tests.__file__)])

Which seems a bit convoluted and, unlike https://github.com/takluyver/flit/blob/b944ecceabe6c01f45d80c3c4c9160f97829e4c3/tox.ini#L14-L34 from the root of the git repo or sdist, is very much not documented.

@michel-slm
Copy link

Tests no longer seem to be installed in 3.10.1 (it was still installed in 3.9) - came across that when updating the Fedora package (and the test deletion failed).

Can this be closed?

@takluyver
Copy link
Member

Yup, I changed this in #691.

@takluyver takluyver added this to the 3.10 milestone Nov 23, 2024
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

4 participants