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

Warn on universal=1 and Requires.Python not allowing Python 2. #396

Open
henryiii opened this issue Mar 9, 2021 · 2 comments
Open

Warn on universal=1 and Requires.Python not allowing Python 2. #396

henryiii opened this issue Mar 9, 2021 · 2 comments

Comments

@henryiii
Copy link
Contributor

henryiii commented Mar 9, 2021

Currently, packages often forget to remove universal=1 when upgrading to Python 3.x+ (not following the four step sequence described by @jaraco here), causing Python 3 only packages to have py2.py3 tags on PyPI (see pre-commit for a high profile example of a Python 3 only package with py2.py3). Another one is setuptools 45.0 (fixed in 45.1).

This is a simpler request than #336: I think it would useful to add a warning when these mismatch. The simplest check would be to see if python 2.7.18 passes python_requires; if it does not, then warn if universal is set.

Other options include making it an error (I don't believe people read warnings, but this would break a lot), or to ignore the setting when Python 2 is excluded. The later would prompt leaving "dirty" setup files, but would keep py2 tags out of py3 only projects.

How long is Python 2 going to be supported, by the way? pypa/packaging is a dep and is dropping Python 2 in the next release. Assuming you could still build universal=1 wheels from Python 3 after Python 2 is dropped, so it would still be better as the above warning rather than always warning on Python 3 only wheel versions. (?)

@hugovk
Copy link
Contributor

hugovk commented Feb 19, 2022

How long is Python 2 going to be supported, by the way?

2.7 and 3.6 were dropped in December in 2fae593, not yet released.

@henryiii
Copy link
Contributor Author

Not really relevant, though - you can still make a universal wheel that will load on Python 2, it just has to be built from Python 3. And setting universal=1 will still give both Python tags, sticking py2 in the filename. As it should, since that what universal=1 means. So it still is wrong to specify it as a user after dropping Python 2. We recently released another package with "wrong" tags because this was missed when removing Python 2.

If universal=1 was to be removed, it should then always produce a warning for a time, but I don't think it's slated for removal.

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

2 participants