Update environment variables doc (#5994)

## Summary

This PR adds descriptions for the `UV_TOOL_DIR`, `UV_PYTHON_INSTALL_DIR`
and `XDG_*` environment variables.

Additionally, it moves some env vars that are not command-line arguments
to the below "uv respects" section.

Closes #5746
This commit is contained in:
Jo 2024-08-16 21:13:40 +08:00 committed by GitHub
parent 15dfb660ab
commit f2d6718038
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 51 additions and 23 deletions

View file

@ -600,9 +600,10 @@ uv accepts the following command-line arguments as environment variables:
a link mode. a link mode.
- `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set, - `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set,
uv will skip isolation when building source distributions. uv will skip isolation when building source distributions.
- `UV_CUSTOM_COMPILE_COMMAND`: Used to override `uv` in the output header of the `requirements.txt` - `UV_CUSTOM_COMPILE_COMMAND`: Equivalent to the `--custom-compile-command` command-line argument.
files generated by `uv pip compile`. Intended for use-cases in which `uv pip compile` is called Used to override uv in the output header of the `requirements.txt` files generated by
from within a wrapper script, to include the name of the wrapper script in the output file. `uv pip compile`. Intended for use-cases in which `uv pip compile` is called from within a wrapper
script, to include the name of the wrapper script in the output file.
- `UV_KEYRING_PROVIDER`: Equivalent to the `--keyring-provider` command-line argument. If set, uv - `UV_KEYRING_PROVIDER`: Equivalent to the `--keyring-provider` command-line argument. If set, uv
will use this value as the keyring provider. will use this value as the keyring provider.
- `UV_CONFIG_FILE`: Equivalent to the `--config-file` command-line argument. Expects a path to a - `UV_CONFIG_FILE`: Equivalent to the `--config-file` command-line argument. Expects a path to a
@ -610,14 +611,22 @@ uv accepts the following command-line arguments as environment variables:
- `UV_NO_CONFIG`: Equivalent to the `--no-config` command-line argument. If set, uv will not read - `UV_NO_CONFIG`: Equivalent to the `--no-config` command-line argument. If set, uv will not read
any configuration files from the current directory, parent directories, or user configuration any configuration files from the current directory, parent directories, or user configuration
directories. directories.
- `UV_CONCURRENT_DOWNLOADS`: Sets the maximum number of in-flight concurrent downloads that `uv` - `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will
will perform at any given time. exclude distributions published after the specified date.
- `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that `uv` will build
In each case, the corresponding command-line argument takes precedence over an environment variable.
In addition, uv respects the following environment variables:
- `UV_CONCURRENT_DOWNLOADS`: Sets the maximum number of in-flight concurrent downloads that uv will
perform at any given time.
- `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that uv will build
concurrently at any given time. concurrently at any given time.
- `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping - `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping
packages. packages.
- `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will - `UV_TOOL_DIR`: Used to specify the directory where uv will store managed tools.
exclude distributions published after the specified date. - `UV_PYTHON_INSTALL_DIR`: Used to specify the directory where uv will store managed Python
installations.
- `UV_PYTHON_INSTALL_MIRROR`: Managed Python installations are downloaded from - `UV_PYTHON_INSTALL_MIRROR`: Managed Python installations are downloaded from
[`python-build-standalone`](https://github.com/indygreg/python-build-standalone). This variable [`python-build-standalone`](https://github.com/indygreg/python-build-standalone). This variable
can be set to a mirror URL to use a different source for Python installations. The provided URL can be set to a mirror URL to use a different source for Python installations. The provided URL
@ -628,11 +637,12 @@ uv accepts the following command-line arguments as environment variables:
different source for PyPy installations. The provided URL will replace different source for PyPy installations. The provided URL will replace
`https://downloads.python.org/pypy` in, e.g., `https://downloads.python.org/pypy` in, e.g.,
`https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`. `https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`.
- `XDG_CONFIG_HOME`: Used to specify the path to uv user-level configuration directory on Linux
In each case, the corresponding command-line argument takes precedence over an environment variable. _and_ macOS systems.
- `XDG_CACHE_HOME`: Used to specify the directory where uv stores cache files on Linux system.
In addition, uv respects the following environment variables: - `XDG_DATA_HOME`: Used to specify the directory where uv stores managed Python installations and
managed tools on Linux system.
- `XDG_BIN_HOME`: Used to specify the directory where executables are installed into.
- `SSL_CERT_FILE`: If set, uv will use this file as the certificate bundle instead of the system's - `SSL_CERT_FILE`: If set, uv will use this file as the certificate bundle instead of the system's
trust store. trust store.
- `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single - `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single

View file

@ -34,25 +34,42 @@ uv accepts the following command-line arguments as environment variables:
uv will require that all dependencies have a hash specified in the requirements file. uv will require that all dependencies have a hash specified in the requirements file.
- `UV_CONSTRAINT`: Equivalent to the `--constraint` command-line argument. If set, uv will use this - `UV_CONSTRAINT`: Equivalent to the `--constraint` command-line argument. If set, uv will use this
file as the constraints file. Uses space-separated list of files. file as the constraints file. Uses space-separated list of files.
- `UV_BUILD_CONSTRAINT`: Equivalent to the `--build-constraint` command-line argument. If set, uv
will use this file as constraints for any source distribution builds. Uses space-separated list of
files.
- `UV_OVERRIDE`: Equivalent to the `--override` command-line argument. If set, uv will use this file
as the overrides file. Uses space-separated list of files.
- `UV_LINK_MODE`: Equivalent to the `--link-mode` command-line argument. If set, uv will use this as - `UV_LINK_MODE`: Equivalent to the `--link-mode` command-line argument. If set, uv will use this as
a link mode. a link mode.
- `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set, - `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set,
uv will skip isolation when building source distributions. uv will skip isolation when building source distributions.
- `UV_CUSTOM_COMPILE_COMMAND`: Used to override uv in the output header of the `requirements.txt` - `UV_CUSTOM_COMPILE_COMMAND`: Equivalent to the `--custom-compile-command` command-line argument.
files generated by `uv pip compile`. Intended for use-cases in which `uv pip compile` is called Used to override uv in the output header of the `requirements.txt` files generated by
from within a wrapper script, to include the name of the wrapper script in the output file. `uv pip compile`. Intended for use-cases in which `uv pip compile` is called from within a wrapper
script, to include the name of the wrapper script in the output file.
- `UV_KEYRING_PROVIDER`: Equivalent to the `--keyring-provider` command-line argument. If set, uv - `UV_KEYRING_PROVIDER`: Equivalent to the `--keyring-provider` command-line argument. If set, uv
will use this value as the keyring provider. will use this value as the keyring provider.
- `UV_CONFIG_FILE`: Equivalent to the `--config-file` command-line argument. Expects a path to a - `UV_CONFIG_FILE`: Equivalent to the `--config-file` command-line argument. Expects a path to a
local `uv.toml` file to use as the configuration file. local `uv.toml` file to use as the configuration file.
- `UV_NO_CONFIG`: Equivalent to the `--no-config` command-line argument. If set, uv will not read
any configuration files from the current directory, parent directories, or user configuration
directories.
- `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will
exclude distributions published after the specified date.
In each case, the corresponding command-line argument takes precedence over an environment variable.
In addition, uv respects the following environment variables:
- `UV_CONCURRENT_DOWNLOADS`: Sets the maximum number of in-flight concurrent downloads that uv will - `UV_CONCURRENT_DOWNLOADS`: Sets the maximum number of in-flight concurrent downloads that uv will
perform at any given time. perform at any given time.
- `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that uv will build - `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that uv will build
concurrently at any given time. concurrently at any given time.
- `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping - `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping
packages. packages.
- `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will - `UV_TOOL_DIR`: Used to specify the directory where uv will store managed tools.
exclude distributions published after the specified date. - `UV_PYTHON_INSTALL_DIR`: Used to specify the directory where uv will store managed Python
installations.
- `UV_PYTHON_INSTALL_MIRROR`: Managed Python installations are downloaded from - `UV_PYTHON_INSTALL_MIRROR`: Managed Python installations are downloaded from
[`python-build-standalone`](https://github.com/indygreg/python-build-standalone). This variable [`python-build-standalone`](https://github.com/indygreg/python-build-standalone). This variable
can be set to a mirror URL to use a different source for Python installations. The provided URL can be set to a mirror URL to use a different source for Python installations. The provided URL
@ -63,11 +80,12 @@ uv accepts the following command-line arguments as environment variables:
different source for PyPy installations. The provided URL will replace different source for PyPy installations. The provided URL will replace
`https://downloads.python.org/pypy` in, e.g., `https://downloads.python.org/pypy` in, e.g.,
`https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`. `https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`.
- `XDG_CONFIG_HOME`: Used to specify the path to uv user-level configuration directory on Linux
In each case, the corresponding command-line argument takes precedence over an environment variable. _and_ macOS systems.
- `XDG_CACHE_HOME`: Used to specify the directory where uv stores cache files on Linux system.
In addition, uv respects the following environment variables: - `XDG_DATA_HOME`: Used to specify the directory where uv stores managed Python installations and
managed tools on Linux system.
- `XDG_BIN_HOME`: Used to specify the directory where executables are installed into.
- `SSL_CERT_FILE`: If set, uv will use this file as the certificate bundle instead of the system's - `SSL_CERT_FILE`: If set, uv will use this file as the certificate bundle instead of the system's
trust store. trust store.
- `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single - `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single