Fix suggestion to use uv help python on invalid install requests (#9820)

Closes https://github.com/astral-sh/uv/issues/9819
This commit is contained in:
Zanie Blue 2024-12-11 12:48:35 -06:00 committed by GitHub
parent ae25c2f4db
commit a41ef21db9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View file

@ -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,

View file

@ -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()
)
})?

View file

@ -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
"###);
}

View file

@ -7726,7 +7726,7 @@ uv venv [OPTIONS] [PATH]
<p>During virtual environment creation, uv will not look for Python interpreters in virtual environments.</p>
<p>See <code>uv python help</code> for details on Python discovery and supported request formats.</p>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p>
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>