mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-01 06:21:13 +00:00
Omit interpreter path from output when using managed Python (#5313)
Extending https://github.com/astral-sh/uv/pull/5311 to the project API
This commit is contained in:
parent
d642705104
commit
eef7a78d7e
1 changed files with 19 additions and 9 deletions
|
@ -207,7 +207,7 @@ impl FoundInterpreter {
|
||||||
let reporter = PythonDownloadReporter::single(printer);
|
let reporter = PythonDownloadReporter::single(printer);
|
||||||
|
|
||||||
// Locate the Python interpreter to use in the environment
|
// Locate the Python interpreter to use in the environment
|
||||||
let interpreter = PythonInstallation::find_or_fetch(
|
let python = PythonInstallation::find_or_fetch(
|
||||||
python_request,
|
python_request,
|
||||||
EnvironmentPreference::OnlySystem,
|
EnvironmentPreference::OnlySystem,
|
||||||
python_preference,
|
python_preference,
|
||||||
|
@ -216,15 +216,25 @@ impl FoundInterpreter {
|
||||||
cache,
|
cache,
|
||||||
Some(&reporter),
|
Some(&reporter),
|
||||||
)
|
)
|
||||||
.await?
|
.await?;
|
||||||
.into_interpreter();
|
|
||||||
|
|
||||||
|
let managed = python.source().is_managed();
|
||||||
|
let interpreter = python.into_interpreter();
|
||||||
|
|
||||||
|
if managed {
|
||||||
|
writeln!(
|
||||||
|
printer.stderr(),
|
||||||
|
"Using Python {}",
|
||||||
|
interpreter.python_version().cyan()
|
||||||
|
)?;
|
||||||
|
} else {
|
||||||
writeln!(
|
writeln!(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"Using Python {} interpreter at: {}",
|
"Using Python {} interpreter at: {}",
|
||||||
interpreter.python_version(),
|
interpreter.python_version(),
|
||||||
interpreter.sys_executable().user_display().cyan()
|
interpreter.sys_executable().user_display().cyan()
|
||||||
)?;
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(requires_python) = requires_python.as_ref() {
|
if let Some(requires_python) = requires_python.as_ref() {
|
||||||
if !requires_python.contains(interpreter.python_version()) {
|
if !requires_python.contains(interpreter.python_version()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue