-
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
Add 'pip cache dir' command to show cache directory #8095
Conversation
I think a lot of folks will benefit from having a way to easily determine the cache directory, especially in CI environments. 🙂 |
def get_cache_dir(self, options, args): | ||
# type: (Values, List[Any]) -> None | ||
if args: | ||
raise CommandError('Too many arguments') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test hitting this branch would be great! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Test added in 6b640d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, other than a non-blocking comment for an additional test.
puts on release manager hat This looks like a useful change, enhancing a feature we've got in the beta. OK to put this into the 20.1 release. |
Fixes #7350.
Print out the path to pip's cache directory, which is different depending on OS.
For example on macOS:
This will allow CIs like GitHub Actions to cache pip downloads with much less config, hopefully increasing use of caching, and should reduce the load and cost of running PyPI.
Others would benefit from this, and some have been resorting to using pip's private, internal API: