Skip to content

Specific pip cache location environment variables #13043

Closed
@zerothi

Description

@zerothi

What's the problem this feature will solve?

On HPC systems, or educational systems where a large number of users are using pip to install packages.
For course specific guides, they tend to install the same packages, and thus has a huge number of duplicated cached wheels located in their respective home folders.

Additionally on HPC systems, one will have a backup of the HOME folders which contains the necessary folders. However, backing up a pip cache seems irrelevant (configuring the backup to disable this folder could be done, but annoying).

Describe the solution you'd like

I would like an environment variable that governs the place of the cache (on HPC facilities this could be specified as a default sourced script.

I would propose the name:

PIP_CACHE_HOME

to match the XDG_CACHE_HOME naming convention.

It is clear that XDG_CACHE_HOME is not a good idea to change, since we don't want to alter other programs cache locations.

Alternative Solutions

We have played with the thought of using the /etc/pip.conf for this:

[global]
cache-dir = /glorious/cache

however, it isn't clear how to easily remove a variable using configuration files?

I.e. how can a user disable the cache-dir to just use the XDG_CACHE_HOME variable instead?

[global]
cache-dir = <what to put here to clear it>

Additional context

Nothing to add.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions