From 623ba3885f98de0eb34bdbd239a623d67a85e6f1 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 26 Jul 2024 20:01:40 -0400 Subject: [PATCH] Add some missing reinstall-refresh calls (#5497) ## Summary Turns out I missed a few of these. --- crates/uv/src/lib.rs | 13 +++++++++---- crates/uv/tests/tool_install.rs | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 3582f5971..c5ca7eef3 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -179,8 +179,9 @@ async fn run(cli: Cli) -> Result { .expect("failed to initialize global rayon pool"); // Initialize the cache. - - let cache = cache.init()?.with_refresh(args.refresh); + let cache = cache + .init()? + .with_refresh(args.settings.reinstall.clone().to_refresh(args.refresh)); let requirements = args .src_file @@ -626,7 +627,9 @@ async fn run(cli: Cli) -> Result { show_settings!(args); // Initialize the cache. - let cache = cache.init()?.with_refresh(args.refresh); + let cache = cache + .init()? + .with_refresh(args.settings.reinstall.clone().to_refresh(args.refresh)); let requirements = args .with @@ -666,7 +669,9 @@ async fn run(cli: Cli) -> Result { show_settings!(args); // Initialize the cache. - let cache = cache.init()?.with_refresh(args.refresh); + let cache = cache + .init()? + .with_refresh(args.settings.reinstall.clone().to_refresh(args.refresh)); let requirements = args .with diff --git a/crates/uv/tests/tool_install.rs b/crates/uv/tests/tool_install.rs index 7f8e160a4..70422d813 100644 --- a/crates/uv/tests/tool_install.rs +++ b/crates/uv/tests/tool_install.rs @@ -740,6 +740,7 @@ fn tool_install_already_installed() { ----- stderr ----- warning: `uv tool install` is experimental and may change without warning Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - black==24.3.0 @@ -773,6 +774,7 @@ fn tool_install_already_installed() { ----- stderr ----- warning: `uv tool install` is experimental and may change without warning Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - black==24.3.0 @@ -796,6 +798,7 @@ fn tool_install_already_installed() { ----- stderr ----- warning: `uv tool install` is experimental and may change without warning Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - click==8.1.7 @@ -869,6 +872,7 @@ fn tool_install_entry_point_exists() { ----- stderr ----- warning: `uv tool install` is experimental and may change without warning Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 + click==8.1.7 @@ -995,6 +999,7 @@ fn tool_install_entry_point_exists() { ----- stderr ----- warning: `uv tool install` is experimental and may change without warning Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - black==24.3.0