mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Optional managed Python archive download cache (#12175)
Part of #11834 Currently, all Python installation are a streaming download-and-extract. With this PR, we add the `UV_PYTHON_CACHE_DIR` variable. When set, the installation is split into downloading the interpreter into `UV_PYTHON_CACHE_DIR` and extracting it there from a second step. If the archive is already present in `UV_PYTHON_CACHE_DIR`, we skip the download. The feature can be used to speed up tests and CI. Locally for me, `cargo test -p uv -- python_install` goes from 43s to 7s (1,7s in release mode) when setting `UV_PYTHON_CACHE_DIR`. It can also be used for offline installation of Python interpreter, by copying the archives to a directory in the offline machine, while the path rewriting is still performed on the target machine on installation.
This commit is contained in:
parent
cfe82dc22a
commit
b33a19689c
7 changed files with 371 additions and 96 deletions
|
@ -339,6 +339,11 @@ this Python interpreter for all operations.
|
|||
|
||||
Specifies the directory to place links to installed, managed Python executables.
|
||||
|
||||
### `UV_PYTHON_CACHE_DIR`
|
||||
|
||||
Specifies the directory for caching the archives of managed Python installations before
|
||||
installation.
|
||||
|
||||
### `UV_PYTHON_DOWNLOADS`
|
||||
|
||||
Equivalent to the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue