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

sdist is missing tox.ini #3253

Closed
mtelka opened this issue Apr 21, 2023 · 6 comments · Fixed by #3263
Closed

sdist is missing tox.ini #3253

mtelka opened this issue Apr 21, 2023 · 6 comments · Fixed by #3263

Comments

@mtelka
Copy link

mtelka commented Apr 21, 2023

The sdist package at PyPI is missing the tox.ini file. Please add the missing file to the sdist package to make downstream testing easier. Thank you.

@bdarnell
Copy link
Member

Unfortunately tox.ini alone is not enough - it references requirements.txt, which is also not included. And this suggests that if I were to do this, I'd need additional testing scenarios to ensure that we didn't add more tox-level dependencies in the future.

We do support downstream testing, but via the python3 -m tornado.test command (which can be used even post-installation, instead of from a source/sdist environment). That is missing some of the esoteric scenarios covered in tox.ini, but it's generally sufficient for downstream testing needs.

I've come to think of sdist files as more "distribution" than "source" - they're an input to pip and similar tools to build installable wheels, but they're not "source" in the sense of being "the preferred form of the work for making modifications to it" (to use the GPL's definition). That's what the git repo is for. If you want to do more testing than python3 -m tornado.test, I recommend checking out the appropriate tag from the git repo.

(our sdists do currently include more than is necessary for the wheel-building use case, but I think I'm more likely to remove the demos and docs from the sdist than to make the sdist a more complete copy of the git repo)

@mtelka
Copy link
Author

mtelka commented Apr 24, 2023

I'm packaging tornado (and many other Python projects) for OpenIndiana. For this we use sdists because they are directly referenced from PyPI so we can find them automatically. During packaging we run tests to make sure the created package works correctly. We usually do so using tox with tox-current-env plugin (in a case the project supports tox). Or pytest, if tox is not supported, but pytest is. Again, this is detected automatically.

Of course, we can run tests in non-standard way (like your suggested python3 -m tornado.test) but we usually try to avoid that if possible, because this needs manual test configuration during the package integration.

AFAIK, sdists were designed since beginning to contain tests. The only file that is sometimes missing in sdists is tox.ini (not counting special files like requirements.txt) for sdists built using the setuptools backend. There are other build backends that include the tox.ini file in sdists automatically.

Thank you.

@bdarnell
Copy link
Member

bdarnell commented May 2, 2023

I'm concerned that with tox-current-env you'll be in unexplored and untested territory. I just tried it and it happens to work now, which was somewhat surprising to me (I remember that back around python 3.4-3.6 our docs and lint test configurations were extremely sensitive to the python version in use, and tox-current-env ignores our configuration there).

I'd rather give you a command like python3 -m tornado.test in some sort of standard way. I was going to suggest python setup.py test but I see now that it's deprecated and they're steering people towards tox (pypa/setuptools#1684). So I guess adding tox.ini and requirements.txt is the right way to go, although I'll reiterate that I don't expect to actually test with tox-current-env myself so if this ever breaks you'll be the one to notice :)

@mtelka
Copy link
Author

mtelka commented May 3, 2023

I completely agree. I do not expect you to do anything related to tox-current-env, so you could completely ignore it. And you very likely should :-). The tox-current-env plugin is designed to be as transparent as possible. I just mentioned it so you could see more detailed picture related to testing performed during packaging Python software for OpenIndiana.

Thank you.

bdarnell added a commit to bdarnell/tornado that referenced this issue May 3, 2023
Also remove the demos directory from sdist. This inclusion was incomplete
and even if it were incomplete I don't think the sdist is a great way to
distribute these demos.

Fixes tornadoweb#3253
@mtelka
Copy link
Author

mtelka commented May 14, 2023

Unfortunately, the 6.3.2 sdist is still missing tox.ini. :-(

@bdarnell
Copy link
Member

Yes, this is just a security fix with no other changes. The sdist change will be in 6.4

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

Successfully merging a pull request may close this issue.

2 participants