Do not throw error in pip cache purge
when there are no cache packages to remove
#10451
Closed
1 task done
Labels
C: cache
Dealing with cache and files in it
state: awaiting PR
Feature discussed, PR is needed
type: feature request
Request for a new feature
What's the problem this feature will solve?
pip cache purge
throws error when no cache packages are not found. This causes issues in automation scripts. For example, when building a Docker image, it is appealing to callpip cache purge
to clean pip caches to reduce Docker image size. However, this command might fail depending whether pip cache packages are found.Describe the solution you'd like
Do not throw errors when no cache packages are found. In the highlighted part of the screenshot below, just return (instead of throwing an exception).
Alternative Solutions
An alternative (and more complicated) way is to add an option to disable error throwing so that users can control the behavior of
pip cache purge
when no caching packages are found.Additional context
NA
Code of Conduct
The text was updated successfully, but these errors were encountered: