-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] Incompatible bdist_wheel.universal and requires-python behaviors build misleading "py2" package #4613
Comments
Related: #1633 for |
Since setuptools doesn't support Python 3.7 and earlier, would it maybe make sense to deprecate this option and make it a no-op? |
That would suit me fine. Possibly a no-op that spits out a warning suggesting to clean up the unused option? I've removed it from my project configs already, but by now sunk quite some time into understanding what it does after inheriting an old config that still had it set. |
@henryiii, I think that is the best thing to do. In theory someone could try to use that option to package Python code that is compatible with old versions of Python to support old systems, but since Python 2.7 itself reached EoL, that does not make much sense to me. We can also put a call to action in the warning to contact us if the user needs this option. |
I should say that when Setuptools dropped support for Python 2, it was dropping support for running under Python 2 but not necessarily dropping support for targeting Python 2. That is, one might build a wheel on Python 3.13 that targets Python 2.7. I note also that Python 2.7 is still supported by PyPy and Jython and IronPython (to the extent that those implementations are supported). I personally don't have any projects targeting Python 2, although I do still use projects that rely on it (Moneydance uses Jython). I do also have backports that if they ever needed a security fix might need to target Python 2 (seems unlikely at this stage). I would not be surprised if there were other environments out there that still target it. I think the OP's issue is a case of the user holding it wrong. "universal" means "build me something that works on Python 2 and Python 3". If the user is indicating universal, it should indicate Python 2. I learned this early on when I first released my packages for Python 3 only, but they still had the By deprecating universal, we're deprecating targeting Python 2, and that seems fine. Users can pull an older setuptools if needed to target Python 2. |
Yup, I mostly agree with that, just with the misfeature that nothing told me I was doing it wrong or how to do it right. So to close this out, could someone just toss a warning into the build somewhere saying "consider removing universal, conflicts with requires-python"? |
setuptools version
setuptools==68.1.2
Python version
Python 3.12.3
OS
Ubuntu Linux 24.04
Additional environment information
No response
Description
Packages built with
bdist_wheel.universal
seem to promote py2 usage even when combined withproject.requires-python = ">= 3"
. Could that be changed to stop implying py2 compatibility and/or have better docs & messaging to clarify how it works?The option name bdist_wheel.universal sounds pretty generic for something that triggers such arcane behavior, and it's not super clear from docs whether universal is supposed to have any meaning anymore after py2 EOL.
Note: Originally reported at pypa/build#806, was told to report here instead.
Expected behavior
When I build packages that explicitly don't support python 2, I'd like to avoid PyPI saying simultaneously that it's a "Python 2" distribution and that it requires Python 3:
I think that entails removing the "py2" from the wheel filename.
How to Reproduce
python -m build
Output
From
python -m build
:Successfully built gcalcli-4.4.0.tar.gz and gcalcli-4.4.0-py2.py3-none-any.whl
From published https://pypi.org/project/gcalcli/4.4.0/#files:
The text was updated successfully, but these errors were encountered: