Skip to content
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

Improve caching topic page #10957

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions docs/html/topics/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,43 @@ pip now caches wheels when building from an immutable Git reference
(i.e. a commit hash).
```

## Where is the cache stored

```{caution}
The exact filesystem structure of pip's cache's contents is considered to be
an implementation detail and may change between any two versions of pip.
```

### `pip cache dir`

```{versionadded} 20.1

```

You can use `pip cache dir` to get the cache directory that pip is currently configured to use.

### Default paths

````{tab} Unix
```
~/.cache/pip
```

pip will also respect `XDG_CACHE_HOME`.
````

````{tab} MacOS
```
~/Library/Caches/pip
```
````

````{tab} Windows
```
%LocalAppData%\pip\Cache
```
````

## Avoiding caching

pip tries to use its cache whenever possible, and it is designed do the right
Expand Down Expand Up @@ -81,8 +118,23 @@ It is also a good idea to remove the offending cached wheel using the

The {ref}`pip cache` command can be used to manage pip's cache.

The exact filesystem structure of pip's cache is considered to be an
implementation detail and may change between any two versions of pip.
### General overview

`pip cache info` provides an overview of the contents of pip's cache, such as the total size and location of various parts of it.

### Removing a single package

`pip cache remove setuptools` removes all wheel files related to setuptools from pip's cache.

### Removing the cache

`pip cache purge` will clear all wheel files from pip's cache.

### Listing cached files

`pip cache list` will list all wheel files from pip's cache.

`pip cache list setuptools` will list all setuptools-related wheel files from pip's cache.

## Disabling caching

Expand Down