Should 'pip cache purge' remove more than wheel files?
See original GitHub issueWhat’s the problem this feature will solve?
https://github.com/pypa/pip/issues/4685 says:
pip’s cache is currently a black box that the users can’t really inspect. This is not the nicest of experiences. Adding a pip cache to allow interacting with the cache (much like the new pip config) would be a good way to fix that.
Currently git cache purge
in #6391 only removes the *.whl
files from the pip/wheels/
directory.
This leaves:
- a lot of empty directories under
pip/wheels/
(eg. 1,608 dirs, 57 KB) - a lot of files under
pip/http/
(eg. 2,408 files, 6,850 dirs, 2.1 GB) - a
selfcheck.json
andpip/selfcheck/
directory (eg. 45 files, 27 KB)
Should they also be cleaned up?
pip cache --help
says `purge will “Remove all items from the cache”, but it doesn’t.
Split out from https://github.com/pypa/pip/pull/6391#issuecomment-554368620 for follow-up after #6391 is merged.
Describe the solution you’d like
-
Should
pip cache purge
remove thepip/wheels/
directory itself so all the subdirs are also cleaned up? In my case, it’s only 57 KB afterwards, but I guess I don’t need those at all, and there’s potential for them to slow down the computer. -
And I also still have a 2.1 GB
pip/http/
directory after purge. Should that also be removed? -
And
selfcheck.json
andpip/selfcheck/
are only 27 KB, but shouldpurge
remove the wholepip/
cache dir?
~I think my pip/wheels/
directory was quite small, especially when compared with pip/wheels/
.~ [typo, cannot remember original]
Alternative Solutions
-
Leave the files and directories as is, to accumulate.
-
Feature request https://github.com/pypa/pip/issues/7350 would allow the user to find out where the cache directory is, and writing their own commands to delete files and directories. It’d be nicer for this to be built into
pip cache purge
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (7 by maintainers)
Top GitHub Comments
I’m working on a PR for this. To start, I’m focusing on three things:
pip cache purge
just remove everything under the http and wheel directories.pip cache remove
prune empty directories.selfcheck.json
if it exists.The
pip/selfcheck/
directory requires more logic, and I may wind up leaving it for a follow-up PR.It’s used as part of the “hey, upgrade your pip” messaging – we shouldn’t remove this.
All OK to delete the empty directories. 😃