Skip to content

pipx uninstall/pipx reinstall after pipx install --editable removes directory tree for installed package; behavior likely undesirable #1718

@ngie-eign

Description

@ngie-eign

Describe the bug

I ran pipx uninstall on a git cloned repo as part of trying to deal with an issue with pipx reinstall for the git clone. I was very surprised when the directory tree for the sources I had been actively developing on had disappeared from my git clone.

Thank goodness I have backups. Scratch that -- my automatic snapshot script didn't catch my edits. Bleh...

How to reproduce

git clone https://github.com/pypa/pipx/ pipx.tmp
pipx install --editable pipx.tmp
pipx uninstall pipx.tmp

Expected behavior

pipx.tmp/ should still exist after running pipx uninstall in the default case, and/or should at the very least prompt the user before packages installed with --editable.

Providing a --force flag and/or --interactive flag to pipx install would help with specifying the user-desired behavior; I'll leave the "default behavior" decision to y'all. I vote for --interactive personally to prevent footshooting, but it's not my project.

More information

% pkg query %v-%n py311-pipx
1.8.0-py311-pipx
% python -V
Python 3.11.14
% uname -rv
14.3-RELEASE-p8 FreeBSD 14.3-RELEASE-p8 GENERIC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions