From 1e2ec4a50c8dc8016714c4228faeb7afca682f32 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 31 Oct 2025 13:11:25 -0500 Subject: [PATCH] Include the Python variant suffix in "Using Python ..." messages (#16536) See https://github.com/astral-sh/uv/issues/16253#issuecomment-3393383573 --- crates/uv/src/commands/pip/operations.rs | 16 ++++++++++------ crates/uv/src/commands/project/mod.rs | 8 +++++--- crates/uv/tests/it/python_install.rs | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 522f6478d..145133142 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -743,9 +743,10 @@ pub(crate) fn report_interpreter( printer.stderr(), "{}", format!( - "Using {} {}", + "Using {} {}{}", implementation.pretty(), - interpreter.python_version() + interpreter.python_version(), + interpreter.variant().suffix(), ) .dimmed() )?; @@ -754,9 +755,10 @@ pub(crate) fn report_interpreter( printer.stderr(), "{}", format!( - "Using {} {} interpreter at: {}", + "Using {} {}{} interpreter at: {}", implementation.pretty(), interpreter.python_version(), + interpreter.variant().suffix(), interpreter.sys_executable().user_display() ) .dimmed() @@ -766,16 +768,18 @@ pub(crate) fn report_interpreter( if managed { writeln!( printer.stderr(), - "Using {} {}", + "Using {} {}{}", implementation.pretty(), - interpreter.python_version().cyan() + interpreter.python_version().cyan(), + interpreter.variant().suffix().cyan() )?; } else { writeln!( printer.stderr(), - "Using {} {} interpreter at: {}", + "Using {} {}{} interpreter at: {}", implementation.pretty(), interpreter.python_version(), + interpreter.variant().suffix(), interpreter.sys_executable().user_display().cyan() )?; } diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index b819ce407..cb6e730e8 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -1008,16 +1008,18 @@ impl ProjectInterpreter { if managed { writeln!( printer.stderr(), - "Using {} {}", + "Using {} {}{}", implementation.pretty(), - interpreter.python_version().cyan() + interpreter.python_version().cyan(), + interpreter.variant().suffix().cyan(), )?; } else { writeln!( printer.stderr(), - "Using {} {} interpreter at: {}", + "Using {} {}{} interpreter at: {}", implementation.pretty(), interpreter.python_version(), + interpreter.variant().suffix(), interpreter.sys_executable().user_display().cyan() )?; } diff --git a/crates/uv/tests/it/python_install.rs b/crates/uv/tests/it/python_install.rs index f7c67a0e4..83d0180fe 100644 --- a/crates/uv/tests/it/python_install.rs +++ b/crates/uv/tests/it/python_install.rs @@ -1130,7 +1130,7 @@ fn python_install_freethreaded() { ----- stdout ----- ----- stderr ----- - Using CPython 3.13.9 + Using CPython 3.13.9t Creating virtual environment at: .venv Activate with: source .venv/[BIN]/activate ");