From a41ef21db9911f887da99ad56dd203744174d423 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 11 Dec 2024 12:48:35 -0600 Subject: [PATCH] Fix suggestion to use `uv help python` on invalid install requests (#9820) Closes https://github.com/astral-sh/uv/issues/9819 --- crates/uv-cli/src/lib.rs | 2 +- crates/uv/src/commands/python/install.rs | 2 +- crates/uv/tests/it/python_install.rs | 6 +++--- docs/reference/cli.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index c27343231..49cbdc720 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -2306,7 +2306,7 @@ pub struct VenvArgs { /// During virtual environment creation, uv will not look for Python /// interpreters in virtual environments. /// - /// See `uv python help` for details on Python discovery and supported + /// See `uv help python` for details on Python discovery and supported /// request formats. #[arg( long, diff --git a/crates/uv/src/commands/python/install.rs b/crates/uv/src/commands/python/install.rs index 591b8a405..645f41780 100644 --- a/crates/uv/src/commands/python/install.rs +++ b/crates/uv/src/commands/python/install.rs @@ -48,7 +48,7 @@ impl InstallRequest { let download_request = PythonDownloadRequest::from_request(&request) .ok_or_else(|| { anyhow::anyhow!( - "`{}` is not a valid Python download request; see `uv python help` for supported formats and `uv python list --only-downloads` for available versions", + "`{}` is not a valid Python download request; see `uv help python` for supported formats and `uv python list --only-downloads` for available versions", request.to_canonical_string() ) })? diff --git a/crates/uv/tests/it/python_install.rs b/crates/uv/tests/it/python_install.rs index 303e7f01e..f521ee3f5 100644 --- a/crates/uv/tests/it/python_install.rs +++ b/crates/uv/tests/it/python_install.rs @@ -491,7 +491,7 @@ fn python_install_invalid_request() { ----- stdout ----- ----- stderr ----- - error: `foobar` is not a valid Python download request; see `uv python help` for supported formats and `uv python list --only-downloads` for available versions + error: `foobar` is not a valid Python download request; see `uv help python` for supported formats and `uv python list --only-downloads` for available versions "###); // Request a version we don't have a download for @@ -824,7 +824,7 @@ fn python_install_unknown() { ----- stdout ----- ----- stderr ----- - error: `foobar` is not a valid Python download request; see `uv python help` for supported formats and `uv python list --only-downloads` for available versions + error: `foobar` is not a valid Python download request; see `uv help python` for supported formats and `uv python list --only-downloads` for available versions "###); context.temp_dir.child("foo").create_dir_all().unwrap(); @@ -836,7 +836,7 @@ fn python_install_unknown() { ----- stdout ----- ----- stderr ----- - error: `./foo` is not a valid Python download request; see `uv python help` for supported formats and `uv python list --only-downloads` for available versions + error: `./foo` is not a valid Python download request; see `uv help python` for supported formats and `uv python list --only-downloads` for available versions "###); } diff --git a/docs/reference/cli.md b/docs/reference/cli.md index afafe6416..987a18c5c 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -7726,7 +7726,7 @@ uv venv [OPTIONS] [PATH]

During virtual environment creation, uv will not look for Python interpreters in virtual environments.

-

See uv python help for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

May also be set with the UV_PYTHON environment variable.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.