mirror of https://github.com/astral-sh/uv
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:
parent
ae25c2f4db
commit
a41ef21db9
|
|
@ -2306,7 +2306,7 @@ pub struct VenvArgs {
|
||||||
/// During virtual environment creation, uv will not look for Python
|
/// During virtual environment creation, uv will not look for Python
|
||||||
/// interpreters in virtual environments.
|
/// 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.
|
/// request formats.
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ impl InstallRequest {
|
||||||
let download_request = PythonDownloadRequest::from_request(&request)
|
let download_request = PythonDownloadRequest::from_request(&request)
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
anyhow::anyhow!(
|
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()
|
request.to_canonical_string()
|
||||||
)
|
)
|
||||||
})?
|
})?
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ fn python_install_invalid_request() {
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- 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
|
// Request a version we don't have a download for
|
||||||
|
|
@ -824,7 +824,7 @@ fn python_install_unknown() {
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- 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();
|
context.temp_dir.child("foo").create_dir_all().unwrap();
|
||||||
|
|
@ -836,7 +836,7 @@ fn python_install_unknown() {
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- 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
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>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>
|
<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>
|
</dd><dt><code>--python-preference</code> <i>python-preference</i></dt><dd><p>Whether to prefer uv-managed or system Python installations.</p>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue