-
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
pip cache remove
should also work with a package name
#13086
Comments
Pex would be happy about this too. It currently goes through both PEP-503 project name normalization and PEP-440 version normalization matching against results from |
I'm starting to look at this. I'll note the existing implementation seems to come with a bug: pip/src/pip/_internal/commands/cache.py Lines 204 to 225 in fe0925b
Since glob expressions allow Worked example: :; python3.8
Python 3.8.20 (default, Sep 7 2024, 12:06:35)
[GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fnmatch
>>> fnmatch.fnmatch("foo0bob-1.0-py3-none-any.whl", "foo[0-9]*.whl")
True
>>> Notes for follow up:
|
That's definitely not intended. Good catch. |
Thanks for confirming @duckinator. There are a few more warts on the glob expression side of "
I'll see if I can't fix those up as well in the course of working this issue. |
Previously, glob patterns were not properly accounted for, which could lead to `pip cache remove wheel-0.45.1-py3-none-any.whl` failing, for example, when exactly that file was shown to exist in the cache via `pip cache list`. Additionally, non-glob patterns previously only literally matched wheel project names; now they match the normalized name. For example, `pip cache remove pyfftw` will now remove a cached `pyFFTW-0.15.0-cp313-cp313-linux_x86_64.whl` wheel since the `pyfftw` pattern matches the normalized project name. Fixes pypa#13086
@duckinator if you have the bandwidth, I'd definitely value your review on #13094. |
@jsirois that PR definitely makes it a lot more in-line with my original intentions. 👍 |
pip cache remove
uses a pattern for the wheels filename and not the package name (as noted in #12954 (comment)):does not work because the wheel name is pyFFTW-0.15.0-cp313-cp313-linux_x86_64.whl (whereas the package name is pyfftw).
One has to use
It seems to me that
pip cache remove pyfftw
should remove the wheels for the package pyfftw.Originally posted by @paugier in #12954 (comment)
The text was updated successfully, but these errors were encountered: