fix(pipx): preserve options when reinstalling tools#9663
Conversation
Greptile SummaryThis PR fixes a bug where
Confidence Score: 5/5Safe to merge; the refactor correctly threads install options through the existing install_version path and the new e2e assertion directly validates the behaviour being fixed. The change is narrow and the logic is sound: list_installed_versions returns ToolVersion objects that carry options from the toolset config when the installed version matches a configured entry, so delegating to install_version with force: true preserves all install-time options that were lost before. The force: true flag triggers the existing uninstall-then-reinstall flow, mirroring the original sequential uv tool uninstall + uv tool install pattern. The e2e test validates end-to-end that --with rich (via uvx_args) survives a Python bump reinstall. No files require special attention. Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/pipx-reinst..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request adds support for uvx_args in the pipx backend and refactors the reinstall_all function to use the standard install_version interface. A review comment points out that the reinstall_all implementation hardcodes dry_run: false in the InstallContext, which could lead to unexpected system changes if a user expects a dry run to be respected.
This comment was marked as outdated.
This comment was marked as outdated.
### 🚀 Features - **(cli)** add minimum release age flag to lock and ls-remote by @risu729 in [#9269](#9269) - **(config)** add run field for hooks by @risu729 in [#9718](#9718) - **(github)** add native oauth token source by @jdx in [#9654](#9654) - **(oci)** scope build to project config by default by @jdx in [#9766](#9766) - add support for prefixed latest version queries in outdated checks by @roele in [#9767](#9767) ### 🐛 Bug Fixes - **(activate)** guard bash chpwd hook under nounset by @risu729 in [#9716](#9716) - **(backend)** date-check latest stable fast path by @risu729 in [#9650](#9650) - **(config)** parse core tool options consistently by @risu729 in [#9742](#9742) - **(exec)** propagate __MISE_DIFF so nested mise recovers pristine PATH by @jdx in [#9765](#9765) - **(forgejo)** include prereleases when opted in by @risu729 in [#9717](#9717) - **(github)** avoid caching empty release assets by @risu729 in [#9616](#9616) - **(java)** resolve lockfile URLs from metadata by @risu729 in [#9719](#9719) - **(lock)** cache unavailable github attestations by @risu729 in [#9741](#9741) - **(pipx)** preserve options when reinstalling tools by @risu729 in [#9663](#9663) - **(python)** skip redundant lockfile provenance verification by @risu729 in [#9739](#9739) - **(vfox)** run pre_uninstall hook by @risu729 in [#9662](#9662) ### 🚜 Refactor - **(schema)** extract tool options definition by @risu729 in [#9649](#9649) ### ⚡ Performance - **(aqua)** bake rkyv aqua package blobs by @risu729 in [#9535](#9535) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#9773](#9773) ### 📦 Registry - add vector ([github:vectordotdev/vector](https://github.com/vectordotdev/vector)) by @kquinsland in [#9761](#9761) - add oc and openshift-install (http backend) by @konono in [#9669](#9669) ### New Contributors - @konono made their first contribution in [#9669](#9669) - @kquinsland made their first contribution in [#9761](#9761)
Summary
uvx_args,pipx_args,extras, and per-tooluvx = falseduring those reinstalls.mise up --bump pythonmust passuvx_argsduring the reinstall step.Analysis
The report is true for the Python-upgrade reinstallation path, not for ordinary pipx tool upgrades.
install_version_already passesuvx_argsandpipx_args, butPIPXBackend::reinstall_allhand-built freshuv tool install/pipx reinstallcommands after a Python upgrade. That bypassed the existing option handling and could reinstall a pipx tool without its configured extras or installer args.I also checked the recently added npm package-manager install args. The npm backend applies
npm_args,pnpm_args,bun_args, andaube_argsinside its normalinstall_version_path, and npm does not have a separate post-Node-upgrade reinstall path equivalent toPIPXBackend::reinstall_all.Source: #7219
Testing
cargo fmt --all -- --checkcargo check --all-featuresmise run test:e2e e2e/backend/test_pipx_uvxNote:
mise run formatwas also attempted, but it failed in the existingtaplo checkregistry schema validation with repeatedInvalid reference: https://mise.en.dev/schema/mise-registry-tool.json#/definitions/oserrors. The schema formatting changes produced before that failure were not included.This PR was generated by an AI coding assistant.