-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Yanked versions listed in ERROR: Could not find a version that satisfies the requirement, but don't get installed #11745
Comments
Its probably a little tricky because it is possible for pip to install a Yanked version, e.g. if you specify package==1.48.0 I imagine the easiest solution if someone wants to make a PR would be to tage the version as yanked in the error message, e.g 1.48.0(Yanked!). Then it would at least make clear to the user that version might not be a candidate? |
I do understand that you can install a yanked version. I guess the whole point of yanking (as opposed to removing the package) is not to break people's code if they use the yanked version already, but on the other hand is to make sure other people without exact version preferences (like in my example above) don't start using the yanked version. Basically, the only problem with the current Marking versions explicitly in the error as yanked may also work. But may be as a separate section in the outout? Like it works for
So, in my example with yanked it could be like this then:
|
I'm not confident it's easy to determine if something was ignored because it was yanked, if pip has to backtrack it could be in one state it considers the yanked package and in another state it doesn't consider the yanked package. Either way though I'm sure Pip maintainers (though I am not one myself so I'm guessing) would seriously consider a PR for this. |
If we can improve the messages pip gives, that would definitely be welcome, yes. However, I think you're right (disclaimer - I haven't looked at this part of the code in a while) that it would be quite hard in practice to get the information. Particularly as the specification allows for only individual files in a release to be yanked, so saying "version X is yanked" isn't entirely accurate (even though I think PyPI only allows yanking of whole releases). TBH, the best way for these sorts of details to get worked out is for someone to create a PR. We're not going to get much further just talking about the problem. To that end, I've marked this as "Awaiting PR". |
Ok, I will try to draft a PR then |
I'd prefer to clean up this logic TBH -- avoiding presenting the entire list of versions unless someone uses an increased verbosity. The tricky thing with this situation is that we know that users use |
Hi 👋 Your idea sounds great @pradyunsg, more info for the users would be great (to somehow allow filtering out yanked versions). Instead of users having to parse the output of this "trick", do you think it would be a nice solution to include a verbose |
Description
Let's say a package has versions published: ..., 1.47.0, 1.47.2, 1.48.0rc1, 1.48.0, 1.48.1, ...
Version 1.48.0 is yanked. So installing
package>1.47.2,<1.48.1
without pre-releases should end up with an errorNo matching distribution found
. It works as expected. But in addition to that in the output(from versions: ...)
I see yanked version 1.48.0 still being listed. It seems to be somewhat misleading to me. If it's listed, why didn't it get installed?Expected behavior
Yanked versions or versions not satisfying env markers, should not be listed in the output for no matching dist error:
pip version
22.3.1
Python version
3.11.1
OS
x86_64 GNU/Linux 5.15.0-58-generic
How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: