From 9ec4234c9e711dca1302b597dd1bebf41d5f9043 Mon Sep 17 00:00:00 2001 From: Taku Kodma <79110363+risu729@users.noreply.github.com> Date: Thu, 7 May 2026 12:06:38 +1000 Subject: [PATCH 1/2] fix(pipx): preserve options when reinstalling tools --- e2e/backend/test_pipx_uvx | 6 ++++-- src/backend/pipx.rs | 34 ++++++++++++---------------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/e2e/backend/test_pipx_uvx b/e2e/backend/test_pipx_uvx index 008ab7e14d..e09b37a363 100644 --- a/e2e/backend/test_pipx_uvx +++ b/e2e/backend/test_pipx_uvx @@ -24,7 +24,7 @@ cat >.mise.toml <'$UPGRADE_LOG' 2>&1" +assert_contains "cat '$UPGRADE_LOG'" "--with click" assert_contains "mise x -- mkdocs --version" "mkdocs, version 1.6.0" diff --git a/src/backend/pipx.rs b/src/backend/pipx.rs index 23d7d84c45..148ccc6d98 100644 --- a/src/backend/pipx.rs +++ b/src/backend/pipx.rs @@ -422,34 +422,24 @@ impl PIPXBackend { } pub async fn reinstall_all(config: &Arc) -> Result<()> { - let ts = ToolsetBuilder::new().build(config).await?; + let ts = Arc::new(ToolsetBuilder::new().build(config).await?); let pipx_tools = ts .list_installed_versions(config) .await? .into_iter() .filter(|(b, _tv)| b.ba().backend_type() == BackendType::Pipx) .collect_vec(); - if Settings::get().pipx.uvx != Some(false) { - let pr = MultiProgressReport::get().add("reinstalling pipx tools with uvx"); - for (b, tv) in pipx_tools { - for (cmd, tool) in &[ - ("uninstall", tv.ba().tool_name.to_string()), - ("install", format!("{}=={}", tv.ba().tool_name, tv.version)), - ] { - let args = &["tool", cmd, tool]; - Self::uvx_cmd(config, args, &*b, &tv, &ts, pr.as_ref()) - .await? - .execute()?; - } - } - } else { - let pr = MultiProgressReport::get().add("reinstalling pipx tools"); - for (b, tv) in pipx_tools { - let args = &["reinstall", &tv.ba().tool_name]; - Self::pipx_cmd(config, args, &*b, &tv, &ts, pr.as_ref()) - .await? - .execute()?; - } + for (b, tv) in pipx_tools { + let ctx = InstallContext { + config: config.clone(), + ts: ts.clone(), + pr: MultiProgressReport::get().add(&format!("reinstalling {}", tv.style())), + force: true, + dry_run: false, + locked: false, + before_date: None, + }; + b.install_version(ctx, tv).await?; } Ok(()) } From ab9a1392e04511be6c3eb8c24c1468a3d52d256c Mon Sep 17 00:00:00 2001 From: Taku Kodma <79110363+risu729@users.noreply.github.com> Date: Thu, 7 May 2026 12:13:45 +1000 Subject: [PATCH 2/2] test(pipx): assert reinstall preserves uvx args --- e2e/backend/test_pipx_uvx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/e2e/backend/test_pipx_uvx b/e2e/backend/test_pipx_uvx index e09b37a363..e69916bdc7 100644 --- a/e2e/backend/test_pipx_uvx +++ b/e2e/backend/test_pipx_uvx @@ -24,7 +24,7 @@ cat >.mise.toml <'$UPGRADE_LOG' 2>&1" -assert_contains "cat '$UPGRADE_LOG'" "--with click" +assert_succeed "mise up --bump python" +assert_succeed "'$MISE_DATA_DIR/installs/pipx-mkdocs/1.6.0/mkdocs/bin/python' -c 'import rich'" assert_contains "mise x -- mkdocs --version" "mkdocs, version 1.6.0"