zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Prevent the creation of universal wheel with Python 3 only package. #358

Closed sallner closed 3 years ago

sallner commented 3 years ago

It just happened to me, that I declared a package as Python 3 only but forgot to change the universal_wheel option in setup.cfg from 1 to 0.

Is there a safety belt or an option to catch this mistake?

As a result, the package will be downloaded from PyPI also by Python 2 pip calls, I guess.

reinout commented 3 years ago

My feeling: such a check would be better added to setuptools/wheel itself. See also a recent change (https://github.com/zestsoftware/zest.releaser/blob/master/CHANGES.rst#6172-2019-03-25) and also #315 . @mauritsvanrees might know more about this :-)

mauritsvanrees commented 3 years ago

The pointers from @reinout are helpful. We call python setup.py bdist_wheel to create a wheel. We have no influence on what kind of wheel is created. I guess the wheel package could check the classifiers in setup.py to see if there are only Python 3 classifiers, and then complain. Similarly, I can imagine a check in wheel to give an error when there are only Python 3 classifiers and you create a wheel with Python 2.7.

In the context of zest.releaser, it may be an idea to do some checks like this in an extension, like pyroma or check-manifest.

sallner commented 3 years ago

Okay, thanks for the quick response. It might be a good idea to get an extension working.