-
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
[24.1] name== hack for listing package versions no longer works #12852
Comments
|
Oh neat! That one isn't in the docs (I assume because it is experimental) that is exactly what I need :D Is there any way to make it use my pip.conf by default so I don't need to specify my index and cert every time? But yeah would also be good if we can get that original behaviour back, at least until this command becomes official. Thanks! |
@uranusjr @pradyunsg @ichard26 although this breakage probably was not intentional- lets stabilize pip index! (#12342) |
I've never really liked this hack and I strongly prefer stabilizing I'd pushed back on this when we added this back into the new resolver (which also "broke" this hack) and my position now is basically the same as it was then: The error we're presenting here is absolutely the right thing to be doing here, since it's specific and provides guidance on what went wrong. We had no reasonable means to get this information earlier but we do now, and I'd really like to stop having people rely on a hack that is non-discoverable via any sensible means, that is exceedingly easy for us to break, that forces us to not be able to improve how the "distribution not found" error is presented and will require some sort of bodge throughout the various pieces to enable.
I think the main thing there is whether the output format is correct and whether we should do something like provide JSON or something by default there. |
I think the main output looks good to me, however a parameter for some for of machine readable version like JSON seems like a good addition as suggested in these two tickets: |
I think that we should stabilize the current main output and then work on additional json api as discussed in #10983
@stretch4x4 Can you provide reproducible example on what happens in that case? I think that can be easily fixed 😄 |
@NoahGorny not a problem First example is equivalent of how I would use the hack ie
|
Hi All, I recently updated pip to 24.1. I also saw the removal of informative error message (with package versions) for Would it be possible to have it back? In my opinion it is not a hack it is a very useful feature that people use. It has been in pip for years. See also, some discussions when it was removed in the past: #9139 Thank you very much for looking into this. |
Hi I'm the lead maintainer for puppet and we've started getting support requests because puppet can no longer retrieve the list of available packages using We've been using this hack since 2016 (see puppetlabs/puppet@152299cc859fc74343c697841848086d4e41b6f8) so it would be great if this hack could be re-enabled, though I understand why you might not want to do that. |
Reading through this, this is my understanding of the issue, let me know if I’m wrong:
If packaging doesn’t parse the requirement it’s not clear, to me, how pip would be able to extract the requirement name and check what versions are available. However, there is a fairly simple workaround for users who want to minimally change their workflow (i.e. not change to
This works because:
Hope that helps someone. |
Name: pip
I really don't know why you keep changing this most basic command. Now using
This most basic command has been used for many years, why was it suddenly changed? |
This command now prompts that it will be deleted. |
It was an error message not a command, relying on the specific output of user facing error messages between tool versions is a recipie for disaster: https://xkcd.com/1172/. The command still works and still gives you an error. If you want the same error message workarounds have been given: #12852 (comment)
No, it prompts that the command is experimental, I think a PR to mark it as stable would be accepted at this point. |
I don't think this issue serves any further constructive discussion. Pip can no longer parse arbitrary strings, such as an empty string, like they are real package versions. This comes from packaging which no longer supports parsing versions that don't comply with the spec (PEP 440 and onwards). The primary command to use this now is As a workaround, you can specify a valid version, but highly unlikely to ever actual exist, e.g. |
|
Pip follows Calver, there are no backwards compatibility guarantees outside patch releases: https://pip.pypa.io/en/stable/development/release-process/. I recommend you pin your pip version if you prioritize stability over new features and improvements. There was various announcements that this version of pip may include unexpected breaking changes and there were multiple beta releases:
No one during this beta period raised an issue that the error message produced by "package==" was relied on.
As previously discussed, I'm sure a PR removing its experimental status would be accepted. |
You "unintentionally" broke the command that was working fine for years. Why not just bring it back? Win-Win: You can easily bring back |
Commment from a side.
Your request @cederom is quite similar to this XKCD comic: Another variant of talking about it is Hyrum's law https://www.hyrumslaw.com/ - which I very much agree with - which explains that with sufficient complexity "any change is breaking". While So I'd say you (and maybe few others) "unintentionally" used something that was never documented.
I would be very interested to see some stats, do you know how many people do it and why you think a "TON" of usages are there? (note that with Also I think it's good if you exercise some empathy towards Converseley - you and few other people changing your scripts to be "proper" - for example use simple API to Pypi in json to retrieve the versions you need (which is about one line of curl + jq or single-liner in Python) is likely something that will take eveyyone a few minutes (but it won't be multiplied by millions) - so this is a "win-win" situation - you get cleaner, future-proof code, and I think you should try to see that from this perspective. |
As already discussed, because |
Just to add - I actually read those earlier comments @cederom - I proposed you to use simple repository API https://packaging.python.org/en/latest/specifications/simple-repository-api/ that does the "trick" in a non-tricky way - because it is actually standardized an it is an "API" in fact. I guess you probably have not read what I wrote, and downvoted my and @notatallshaw comments without tryiing to understand what I wrote. I personally prefer to solve a problem rather than win an argument, and you got reasonable proposal on how to do it, you can follow it to solve the problem or try to win an argument - up to you. |
Description
Previously you could skip the version definition to get a list of version numbers that were compatible with your environment.
This was really helpful for debugging or checking if a mirror had picked up an upstream package yet.
Pip 24.0:
Pip 24.1.2 (happens from 24.1b1 onwards)
I assume this was a bit of an undocumented feature and is part of the
Remove support for legacy versions and dependency specifiers.
change but I can't find an alternative way to get this information.This is quite similar to #12749 but focusing on the version numbers rather than the urls
Expected behavior
A list of potential package versions that are compatible with my system.
pip version
24.1.*
Python version
3.11.5
OS
Ubuntu 22.04
How to Reproduce
pip install <package name>==
egpip install pip==
pip install <package name>==
egpip install pip==
Output
$ pip install pip==
Looking in indexes: https://token:****@dl.cloudsmith.io/basic/___/pre-release/python/simple/
ERROR: Could not find a version that satisfies the requirement pip== (from versions: 0.2, 0.2.1, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.2, 1.2.1,
1.3, 1.3.1, 1.4, 1.4.1, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.1.0, 6.1.1, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.1.0, 8
.1.1, 8.1.2, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 10.0.0b1, 10.0.0b2, 10.0.0, 10.0.1, 18.0, 18.1, 19.0, 19.0.1, 19.0.2, 19.0.3, 19.1, 19.1.1, 19.2, 19.2.1, 19.2.2, 19.2.3, 19.3, 19.3.1, 20.0, 20.0.1, 20.0.2, 20.1b1, 20.1, 20.1.1, 20.2b1, 20.
2, 20.2.1, 20.2.2, 20.2.3, 20.2.4, 20.3b1, 20.3, 20.3.1, 20.3.2, 20.3.3, 20.3.4, 21.0, 21.0.1, 21.1, 21.1.1, 21.1.2, 21.1.3, 21.2, 21.2.1, 21.2.2, 21.2.3, 21.2.4, 21.3, 21.3.1, 22.0, 22.0.1, 22.0.2, 22.0.3, 22.0.4, 22.1b1, 22.1, 22.1.1, 22.1.2, 22.2, 22.2.1, 22.2.2, 22.3, 22.3.1, 23.0, 23.0.1, 23.1, 23.1.1, 23.1.2, 23.2, 23.2.1, 23.3, 23.3.1, 23.3.2, 24.0, 24.1b1, 24.1b2, 24.1, 24.1.1, 24.1.2)
ERROR: No matching distribution found for pip==
$ pip install pip==
ERROR: Invalid requirement: 'pip==': Expected end or semicolon (after name and no valid version specifier)
pip==
^
Code of Conduct
The text was updated successfully, but these errors were encountered: