pipx icon indicating copy to clipboard operation
pipx copied to clipboard

pipx uninject leaves behind broken links for dependency apps in ~/.local/bin

Open doolio opened this issue 1 year ago • 0 comments

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

  1. Install a package e.g. pipx install python-lsp-server
  2. 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-ruff has a dependency on ruff)
  3. pipx list --include-injected shows:
   package python-lsp-server 1.11.0, installed using Python 3.12.2
    - pylsp
    - ruff
    Injected Packages:
      - python-lsp-ruff 2.2.0
  1. Remove the package injected in step 2 e.g. pipx uninject python-lsp-server python-lsp-ruff
  2. pipx list --include-injected shows:
   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.

  1. which ruffgives bash: type: ruff: not found and ~/.local/bin shows:

image

Expected behavior

The links to the dependency apps should be removed if the uninject --leave-deps option is not used.

doolio avatar Apr 23 '24 22:04 doolio