Skip to content

Commit 5eba64a

Browse files
Add installer variables to environment reference (#8874)
## Summary I decided to omit the new URL options from the installer configuration page since they're pretty niche.
1 parent eb8498d commit 5eba64a

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

crates/uv-static/src/env_vars.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl EnvVars {
448448
#[attr_hidden]
449449
pub const PYTHONUTF8: &'static str = "PYTHONUTF8";
450450

451-
/// Adds directories to Python module search path (e.g., PYTHONPATH=/path/to/modules).
451+
/// Adds directories to Python module search path (e.g., `PYTHONPATH=/path/to/modules`).
452452
pub const PYTHONPATH: &'static str = "PYTHONPATH";
453453

454454
/// Used in tests to enforce a consistent locale setting.
@@ -528,4 +528,24 @@ impl EnvVars {
528528

529529
/// Ignore `.env` files when executing `uv run` commands.
530530
pub const UV_NO_ENV_FILE: &'static str = "UV_NO_ENV_FILE";
531+
532+
/// The URL from which to download uv using the standalone installer and `self update` feature,
533+
/// in lieu of the default GitHub URL.
534+
pub const UV_INSTALLER_GITHUB_BASE_URL: &'static str = "UV_INSTALLER_GITHUB_BASE_URL";
535+
536+
/// The URL from which to download uv using the standalone installer and `self update` feature,
537+
/// in lieu of the default GitHub Enterprise URL.
538+
pub const UV_INSTALLER_GHE_BASE_URL: &'static str = "UV_INSTALLER_GHE_BASE_URL";
539+
540+
/// The directory in which to install uv using the standalone installer and `self update` feature.
541+
/// Defaults to `~/.cargo/bin`.
542+
pub const UV_INSTALL_DIR: &'static str = "UV_INSTALL_DIR";
543+
544+
/// Used ephemeral environments like CI to install uv to a specific path while preventing
545+
/// the installer from modifying shell profiles or environment variables.
546+
pub const UV_UNMANAGED_INSTALL: &'static str = "UV_UNMANAGED_INSTALL";
547+
548+
/// Avoid modifying the `PATH` environment variable when installing uv using the standalone
549+
/// installer and `self update` feature.
550+
pub const INSTALLER_NO_MODIFY_PATH: &'static str = "INSTALLER_NO_MODIFY_PATH";
531551
}

docs/configuration/environment.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ uv respects the following environment variables:
164164
- <a id="GITHUB_ACTIONS"></a> [`GITHUB_ACTIONS`](#GITHUB_ACTIONS): Used for trusted publishing via `uv publish`.
165165
- <a id="ACTIONS_ID_TOKEN_REQUEST_URL"></a> [`ACTIONS_ID_TOKEN_REQUEST_URL`](#ACTIONS_ID_TOKEN_REQUEST_URL): Used for trusted publishing via `uv publish`. Contains the oidc token url.
166166
- <a id="ACTIONS_ID_TOKEN_REQUEST_TOKEN"></a> [`ACTIONS_ID_TOKEN_REQUEST_TOKEN`](#ACTIONS_ID_TOKEN_REQUEST_TOKEN): Used for trusted publishing via `uv publish`. Contains the oidc request token.
167-
- <a id="PYTHONPATH"></a> [`PYTHONPATH`](#PYTHONPATH): Adds directories to Python module search path (e.g., PYTHONPATH=/path/to/modules).
167+
- <a id="PYTHONPATH"></a> [`PYTHONPATH`](#PYTHONPATH): Adds directories to Python module search path (e.g., `PYTHONPATH=/path/to/modules`).
168168
- <a id="NETRC"></a> [`NETRC`](#NETRC): Use to set the .netrc file location.
169169
- <a id="PAGER"></a> [`PAGER`](#PAGER): The standard `PAGER` posix env var. Used by `uv` to configure the appropriate pager.
170170
- <a id="JPY_SESSION_NAME"></a> [`JPY_SESSION_NAME`](#JPY_SESSION_NAME): Used to detect when running inside a Jupyter notebook.
@@ -178,3 +178,13 @@ uv respects the following environment variables:
178178
for more.
179179
- <a id="UV_ENV_FILE"></a> [`UV_ENV_FILE`](#UV_ENV_FILE): `.env` files from which to load environment variables when executing `uv run` commands.
180180
- <a id="UV_NO_ENV_FILE"></a> [`UV_NO_ENV_FILE`](#UV_NO_ENV_FILE): Ignore `.env` files when executing `uv run` commands.
181+
- <a id="UV_INSTALLER_GITHUB_BASE_URL"></a> [`UV_INSTALLER_GITHUB_BASE_URL`](#UV_INSTALLER_GITHUB_BASE_URL): The URL from which to download uv using the standalone installer and `self update` feature,
182+
in lieu of the default GitHub URL.
183+
- <a id="UV_INSTALLER_GHE_BASE_URL"></a> [`UV_INSTALLER_GHE_BASE_URL`](#UV_INSTALLER_GHE_BASE_URL): The URL from which to download uv using the standalone installer and `self update` feature,
184+
in lieu of the default GitHub Enterprise URL.
185+
- <a id="UV_INSTALL_DIR"></a> [`UV_INSTALL_DIR`](#UV_INSTALL_DIR): The directory in which to install uv using the standalone installer and `self update` feature.
186+
Defaults to `~/.cargo/bin`.
187+
- <a id="UV_UNMANAGED_INSTALL"></a> [`UV_UNMANAGED_INSTALL`](#UV_UNMANAGED_INSTALL): Used ephemeral environments like CI to install uv to a specific path while preventing
188+
the installer from modifying shell profiles or environment variables.
189+
- <a id="INSTALLER_NO_MODIFY_PATH"></a> [`INSTALLER_NO_MODIFY_PATH`](#INSTALLER_NO_MODIFY_PATH): Avoid modifying the `PATH` environment variable when installing uv using the standalone
190+
installer and `self update` feature.

0 commit comments

Comments
 (0)