From 496daaf4ee8c88091c82fff2871d07ba2de5e213 Mon Sep 17 00:00:00 2001 From: j178 <10510431+j178@users.noreply.github.com> Date: Sat, 10 Aug 2024 21:35:40 +0800 Subject: [PATCH] Update environment variables doc --- README.md | 36 ++++++++++++++++++----------- docs/configuration/environment.md | 38 +++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index baf293c551d1..6fb96e0ac9a3 100644 --- a/README.md +++ b/README.md @@ -600,9 +600,10 @@ uv accepts the following command-line arguments as environment variables: a link mode. - `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set, uv will skip isolation when building source distributions. -- `UV_CUSTOM_COMPILE_COMMAND`: Used to override `uv` in the output header of the `requirements.txt` - files generated by `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_CUSTOM_COMPILE_COMMAND`: Equivalent to the `--custom-compile-command` command-line argument. + Used to override uv in the output header of the `requirements.txt` files generated by + `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 will use this value as the keyring provider. - `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 any configuration files from the current directory, parent directories, or user configuration directories. -- `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 +- `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 + perform at any given time. +- `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that uv will build concurrently at any given time. - `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping packages. -- `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will - exclude distributions published after the specified date. +- `UV_TOOL_DIR`: Used to specify the directory where uv will store managed tools. +- `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 [`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 @@ -628,11 +637,12 @@ uv accepts the following command-line arguments as environment variables: different source for PyPy installations. The provided URL will replace `https://downloads.python.org/pypy` in, e.g., `https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`. - -In each case, the corresponding command-line argument takes precedence over an environment variable. - -In addition, uv respects the following environment variables: - +- `XDG_CONFIG_HOME`: Used to specify the path to uv user-level configuration directory on Linux + _and_ macOS systems. +- `XDG_CACHE_HOME`: Used to specify the directory where uv stores cache files on Linux system. +- `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 trust store. - `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single diff --git a/docs/configuration/environment.md b/docs/configuration/environment.md index 3948f9c7ce57..a16296e62527 100644 --- a/docs/configuration/environment.md +++ b/docs/configuration/environment.md @@ -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_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. +- `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 a link mode. - `UV_NO_BUILD_ISOLATION`: Equivalent to the `--no-build-isolation` command-line argument. If set, uv will skip isolation when building source distributions. -- `UV_CUSTOM_COMPILE_COMMAND`: Used to override uv in the output header of the `requirements.txt` - files generated by `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_CUSTOM_COMPILE_COMMAND`: Equivalent to the `--custom-compile-command` command-line argument. + Used to override uv in the output header of the `requirements.txt` files generated by + `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 will use this value as the keyring provider. - `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. +- `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 perform at any given time. - `UV_CONCURRENT_BUILDS`: Sets the maximum number of source distributions that uv will build concurrently at any given time. - `UV_CONCURRENT_INSTALLS`: Used to control the number of threads used when installing and unzipping packages. -- `UV_EXCLUDE_NEWER`: Equivalent to the `--exclude-newer` command-line argument. If set, uv will - exclude distributions published after the specified date. +- `UV_TOOL_DIR`: Used to specify the directory where uv will store managed tools. +- `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 [`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 @@ -63,11 +80,12 @@ uv accepts the following command-line arguments as environment variables: different source for PyPy installations. The provided URL will replace `https://downloads.python.org/pypy` in, e.g., `https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`. - -In each case, the corresponding command-line argument takes precedence over an environment variable. - -In addition, uv respects the following environment variables: - +- `XDG_CONFIG_HOME`: Used to specify the path to uv user-level configuration directory on Linux + _and_ macOS systems. +- `XDG_CACHE_HOME`: Used to specify the directory where uv stores cache files on Linux system. +- `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 trust store. - `SSL_CLIENT_CERT`: If set, uv will use this file for mTLS authentication. This should be a single