pipx
pipx copied to clipboard
pipx uninject leaves behind broken links for dependency apps in ~/.local/bin
Describe the bug
When uninjecting a dependency (which had its own dependencies apps exposed through --include-deps) from an installed package the dependency and the dependency's dependencies apps are removed as expected but broken links for the dependency's dependencies apps remain in ~/.local/bin.
How to reproduce
- Install a package e.g.
pipx install python-lsp-server - Inject a package (with dependency app(s)) into the venv created for the package installed in step 1 and expose the app(s)
e.g.
pipx inject --include-deps python-lsp-server python-lsp-ruff(python-lsp-ruffhas a dependency onruff) -
pipx list --include-injectedshows:
package python-lsp-server 1.11.0, installed using Python 3.12.2
- pylsp
- ruff
Injected Packages:
- python-lsp-ruff 2.2.0
- Remove the package injected in step 2 e.g.
pipx uninject python-lsp-server python-lsp-ruff -
pipx list --include-injectedshows:
package python-lsp-server 1.11.0, installed using Python 3.12.2
- pylsp
- ruff
Notice, ruff is still listed as exposed but it is not.
-
which ruffgivesbash: type: ruff: not foundand~/.local/binshows:
Expected behavior
The links to the dependency apps should be removed if the uninject --leave-deps option is not used.