From 60ea656bdcc541463072f4c937ce59697d00173b Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Tue, 17 Sep 2024 11:44:43 +0200 Subject: [PATCH] dropme: windows CI debug log --- crates/uv/src/commands/tool/install.rs | 10 +++++ crates/uv/tests/tool_install.rs | 55 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/crates/uv/src/commands/tool/install.rs b/crates/uv/src/commands/tool/install.rs index cd1bfed0c8fa..97f9231c1d06 100644 --- a/crates/uv/src/commands/tool/install.rs +++ b/crates/uv/src/commands/tool/install.rs @@ -293,6 +293,16 @@ pub(crate) async fn install( "Ignored existing environment for `{from}` due to stale Python interpreter", from = from.name.cyan(), ); + // XXX(lucab) + #[cfg(target_os = "windows")] + { + let _ = writeln!( + printer.stderr(), + "Interpreter mismatch: old='{}' vs new='{}'", + old_interpreter.display(), + selected_interpreter.display(), + ); + } } same_executable }); diff --git a/crates/uv/tests/tool_install.rs b/crates/uv/tests/tool_install.rs index 6a3bb07ba8e3..585a77da68f9 100644 --- a/crates/uv/tests/tool_install.rs +++ b/crates/uv/tests/tool_install.rs @@ -2215,6 +2215,61 @@ fn tool_install_python_params() { "###); } +// XXX(lucab) +#[test] +fn tool_install_debug_windows_ci() { + let context = TestContext::new_with_versions(&["3.11", "3.12"]) + .with_filtered_counts() + .with_filtered_exe_suffix(); + let tool_dir = context.temp_dir.child("tools"); + let bin_dir = context.temp_dir.child("bin"); + + // Install with managed Python 3.11. + uv_snapshot!(context.filters(), context.tool_install() + .arg("-p") + .arg("3.11") + .arg("--python-preference") + .arg("only-managed") + .arg("black") + .env("UV_TOOL_DIR", tool_dir.as_os_str()) + .env("XDG_BIN_HOME", bin_dir.as_os_str()) + .env("PATH", bin_dir.as_os_str()), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] + Installed [N] packages in [TIME] + + black==24.3.0 + + click==8.1.7 + + mypy-extensions==1.0.0 + + packaging==24.0 + + pathspec==0.12.1 + + platformdirs==4.2.0 + Installed 2 executables: black, blackd + "###); + + // Install with managed Python 3.11 (exact same command). + uv_snapshot!(context.filters(), context.tool_install() + .arg("-p") + .arg("3.11") + .arg("--python-preference") + .arg("only-managed") + .arg("black") + .env("UV_TOOL_DIR", tool_dir.as_os_str()) + .env("XDG_BIN_HOME", bin_dir.as_os_str()) + .env("PATH", bin_dir.as_os_str()), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + `black` is already installed + "###); +} + /// Test preserving a tool environment when new but incompatible requirements are requested. #[test] fn tool_install_preserve_environment() {