-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Python 3.10: pip installs wheel for ancient Python versions #10617
Comments
Can you run |
Link to the gist: https://gist.github.com/albertosottile/242434120f73d7e73ed2063ef954bc16 |
Python 3.10 is compatible with If the user is saying "install py2exe", arguably 0.9.2.2 is better than saying "I can't install py2exe". So pip's behaviour is right (although I agree it's surprising, and likely not what the user actually wanted). The user could say |
Thanks for your explanation, I now understand the behavior, I did not expect that the old is there a way to stop this behavior without actually deleting the releases and the wheels from PyPI? Is it possible to mark some old releases as obsolete, so that |
Yanking should work right? Pip still skip over them normally but if you specify the exact version it will still use it? |
I learned a lot today, I did not know yanked releases were accessible via |
Looks like it does not work, I deleted the rogue source archive of 0.10.0.2 and yanked every release before 0.10, but now this happens:
It seems that |
Yeah because (quoting PEP 592)
And the approach pip currently implements is "use a yanked distribution if no non-yanked distributions satisfy the user request". Which is technically allowed by the PEP, but probably not the best approach. |
Ah my mistake, I thought there was something special about selecting an exact version but I guess pip just chooses a yanked packages in that case because it's the only one available. |
There's a related open issue on this as well. As described in #8262 (comment), it is likely pip should tighten up the logic to ignore yanked version entirely unless the version range specifiers leading to the distribution selection contains |
Would you be interested in a PR regarding this? Technically, I think the fix might be limited to patching ffb3d1b as it follows: Current: pip/src/pip/_internal/resolution/resolvelib/factory.py Lines 276 to 284 in e46888b
After (EDIT): # PackageFinder returns earlier versions first, so we reverse.
for ican in reversed(icans):
if (all_yanked and not specifier) and ican.link.is_yanked:
continue EDIT: the solution might not be that trivial. One might skip unless there's a specifier (see above), or unless However, I guess the core of the issue is more political. Is this is a behavior change that you would like to have in |
I think this would be a good change since it fixes a real issue (the one we have here), and those negatively impacted have a relatively easy way out (by adding a Regarding the implementation, the simplest design would be to only allow a yanked distribution only if the user uses |
I just created PR #10625 with the proposed change. |
Description
I am the current maintainer of
py2exe
https://github.com/py2exe/py2exe and I still have not released a version of the package for Python 3.10,However, users reported that they were able to install the package on their system. When questioned, they reported that
pip
first tries to install from some old sources (py2exe-0.10.0.2.tar.gz
). I am sure this is my fault andsetup.py
is not proper there, and I intend to delete this rogue release.Unfortunately, after this failed attempt,
pip
picks an even older wheel which is not compatible at all with 3.10 (py2exe-0.9.2.2-py33.py34-none-any.whl
) and claims that the package was successfully installed.I can delete the rogue 0.10.0.2 source archive, but I would like not to delete also all the releases before that one. Could you tell me why this is happening and if is there anything, besides deleting all past releases, that I can do?
Thank you for your assistance
Expected behavior
pip
should either say that no version compatible with the platform was found or try to install from the source archive and fail due to the lack of dependencies/compiler.pip version
21.3.1
Python version
3.10.0
OS
Microsoft Windows [Version 10.0.17763.2183]
How to Reproduce
pip install py2exe
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: