Skip to content

Commit

Permalink
dropme: windows CI debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
lucab committed Sep 17, 2024
1 parent 1232452 commit 096d764
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/uv/src/commands/tool/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
59 changes: 59 additions & 0 deletions crates/uv/tests/tool_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,65 @@ 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("--no-python-downloads")
.arg("--python-preference")
.arg("only-system")
.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("--no-python-downloads")
.arg("--python-preference")
// NOTE(lucab): test does NOT pass with 'managed' (the default)
// NOTE(lucab): test passes with 'only-managed'
.arg("only-system")
.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() {
Expand Down

0 comments on commit 096d764

Please sign in to comment.