From 69621478318774cd1c76662fa5044f040d039fc2 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 22 May 2024 14:26:35 -0400 Subject: [PATCH] Add display of interpreter request (#3751) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e.g. ``` ❯ echo "anyio" | cargo run -q -- pip compile - --python 3.9 -v DEBUG Searching for interpreter that fulfills Python @ 3.9 DEBUG Found a virtual environment at: /Users/zb/workspace/uv/.venv DEBUG Using Python 3.9.18 interpreter at bin/cpython-3.9.18-macos-aarch64-none/install/bin/python3 for builds ``` --- crates/uv-interpreter/src/discovery.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/uv-interpreter/src/discovery.rs b/crates/uv-interpreter/src/discovery.rs index 868adeb51..c761750c2 100644 --- a/crates/uv-interpreter/src/discovery.rs +++ b/crates/uv-interpreter/src/discovery.rs @@ -431,6 +431,7 @@ pub fn find_interpreter( sources: &SourceSelector, cache: &Cache, ) -> Result { + debug!("Searching for interpreter that fulfills {request}"); let result = match request { InterpreterRequest::File(path) => { if !sources.contains(InterpreterSource::ProvidedPath) { @@ -1137,15 +1138,15 @@ impl SystemPython { impl fmt::Display for InterpreterRequest { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { - Self::Version(version) => write!(f, "python@{version}"), + Self::Version(version) => write!(f, "Python @ {version}"), Self::Directory(path) => write!(f, "directory {}", path.user_display()), Self::File(path) => write!(f, "file {}", path.user_display()), - Self::ExecutableName(name) => write!(f, "executable `{name}`"), + Self::ExecutableName(name) => write!(f, "executable name `{name}`"), Self::Implementation(implementation) => { write!(f, "{implementation}") } Self::ImplementationVersion(implementation, version) => { - write!(f, "{implementation}@{version}") + write!(f, "{implementation} @ {version}") } } }