From 87ab57e902c9009b47f22d951acf631b515e3bed Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 12 Jun 2025 05:02:51 -0500 Subject: [PATCH] Update the CLI help and reference to include references to the Python bin directory (#13978) Closes https://github.com/astral-sh/uv/issues/13977 --- crates/uv-cli/src/lib.rs | 6 ++++-- crates/uv/tests/it/help.rs | 3 ++- docs/reference/cli.md | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 63e87367c..e29387b28 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -4728,7 +4728,8 @@ pub enum PythonCommand { /// /// A `python` executable is not made globally available, managed Python versions are only used /// in uv commands or in active virtual environments. There is experimental support for adding - /// Python executables to the `PATH` — use the `--preview` flag to enable this behavior. + /// Python executables to a directory on the path — use the `--preview` flag to enable this + /// behavior and `uv python dir --bin` to retrieve the target directory. /// /// Multiple Python versions may be requested. /// @@ -4763,7 +4764,8 @@ pub enum PythonCommand { /// The Python installation directory may be overridden with `$UV_PYTHON_INSTALL_DIR`. /// /// To view the directory where uv installs Python executables instead, use the `--bin` flag. - /// Note that Python executables are only installed when preview mode is enabled. + /// The Python executable directory may be overridden with `$UV_PYTHON_BIN_DIR`. Note that + /// Python executables are only installed when preview mode is enabled. Dir(PythonDirArgs), /// Uninstall Python versions. diff --git a/crates/uv/tests/it/help.rs b/crates/uv/tests/it/help.rs index 932991859..6fd9bd466 100644 --- a/crates/uv/tests/it/help.rs +++ b/crates/uv/tests/it/help.rs @@ -468,7 +468,8 @@ fn help_subsubcommand() { A `python` executable is not made globally available, managed Python versions are only used in uv commands or in active virtual environments. There is experimental support for adding Python - executables to the `PATH` — use the `--preview` flag to enable this behavior. + executables to a directory on the path — use the `--preview` flag to enable this behavior and `uv + python dir --bin` to retrieve the target directory. Multiple Python versions may be requested. diff --git a/docs/reference/cli.md b/docs/reference/cli.md index aef894368..d434b954b 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -2666,7 +2666,7 @@ Supports CPython and PyPy. CPython distributions are downloaded from the Astral Python versions are installed into the uv Python directory, which can be retrieved with `uv python dir`. -A `python` executable is not made globally available, managed Python versions are only used in uv commands or in active virtual environments. There is experimental support for adding Python executables to the `PATH` — use the `--preview` flag to enable this behavior. +A `python` executable is not made globally available, managed Python versions are only used in uv commands or in active virtual environments. There is experimental support for adding Python executables to a directory on the path — use the `--preview` flag to enable this behavior and `uv python dir --bin` to retrieve the target directory. Multiple Python versions may be requested. @@ -2917,7 +2917,7 @@ By default, Python installations are stored in the uv data directory at `$XDG_DA The Python installation directory may be overridden with `$UV_PYTHON_INSTALL_DIR`. -To view the directory where uv installs Python executables instead, use the `--bin` flag. Note that Python executables are only installed when preview mode is enabled. +To view the directory where uv installs Python executables instead, use the `--bin` flag. The Python executable directory may be overridden with `$UV_PYTHON_BIN_DIR`. Note that Python executables are only installed when preview mode is enabled.

Usage