Skip to content

Include tests in PyPI source tarball #473

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

Closed
jluttine opened this issue Jun 6, 2018 · 7 comments
Closed

Include tests in PyPI source tarball #473

jluttine opened this issue Jun 6, 2018 · 7 comments
Labels

Comments

@jluttine
Copy link

jluttine commented Jun 6, 2018

It would be nice if the PyPI source tarball included the tests so one can run them after installing to check that it works. Running package tests is extremely useful and important when packaging for a Linux distro as I'm doing at the moment, so I'd love to have the tests included. I think this is good practice.

@wholmgren
Copy link
Member

I'm not opposed but is this the standard for other "pydata" projects? I usually look to pandas (big), xarray (medium), metpy (smaller) as examples to try to follow. How do they manage this?

@jluttine
Copy link
Author

jluttine commented Jun 6, 2018

Pandas and xarray include tests in PyPI source tarball. For some reason, metpy doesn't.

Some references I found quickly:

@jluttine
Copy link
Author

jluttine commented Jun 6, 2018

Also NumPy and SciPy include tests in the source tarball in PyPI.

@mikofski
Copy link
Member

mikofski commented Jun 6, 2018

I usually put tests and documentation source in the sdist or source distribution which is uploaded to PyPI as a tarball or zip file, but not in the wheels or other binary distributions.

If the tests include a lot of test data then it would be an unnecessary burden to put the in wheels, but I suppose if they are smell enough then it doesn't matter.

There was a discussion about this on the SciPy Dev mail list, in their case the tests were so big that they're considering moving the test data to a separate repo altogether, and either accessing it through an API or having testers clone the repo. There is an upside to have a shared public test data repo for multiple projects with similar test data, then the data can also be used in the docs as examples and the examples can be more realistic or rocket in their demonstrative power

@wholmgren
Copy link
Member

With only a quick read of our manifest/setup.py and comparing with xarray/pandas, I am surprised that our tests are not already bundled. What do we need to do differently? Pull request welcome. Or edit the release procedures wiki.

Note that the test_forecast.py tests frequently fail due to issues with the data on the server (I think) so you'd probably want to exclude those and/or improve them.

A separate test repo sounds like a lot of work to me.

@mikofski
Copy link
Member

mikofski commented Jun 6, 2018

There already is a shared test data repo for R, I think maybe it's datasets there are efforts in Python to read them I think? As I said you can read the thread in SciPy devs starting in March

@wholmgren
Copy link
Member

closed by #580

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

No branches or pull requests

3 participants