Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip uninstall does not remove symlinks created by flit install --symlink #6892

Closed
sbidoul opened this issue Aug 18, 2019 · 2 comments · Fixed by #6914
Closed

pip uninstall does not remove symlinks created by flit install --symlink #6892

sbidoul opened this issue Aug 18, 2019 · 2 comments · Fixed by #6914
Labels
auto-locked Outdated issues that have been locked by automation C: uninstall The logic for uninstallation of packages type: bug A confirmed bug or unintended behavior

Comments

@sbidoul
Copy link
Member

sbidoul commented Aug 18, 2019

Environment

  • pip version: 19.2
  • Python version: 3
  • OS: linux

Description

pip uninstall does not remove symlinks created in a virtualenv by flit install --symlink,
because it thinks they are outside the virtualenv prefix.

Expected behavior

Such symlinks should be removed by pip uninstall

How to Reproduce

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -U pip
$ git clone https://github.com/pypa/pep517.git  # example flit project
$ cd pep517
$ pip install flit
$ flit install --symlink
$ pip uninstall pep517
Uninstalling pep517-0.6.0:
  Would remove:
    /home/my/.virtualenvs/tempenv-2d6243995df5/lib/python3.7/site-packages/pep517-0.6.0.dist-info/*
  Would not remove (outside of prefix):
    /home/my/.virtualenvs/tempenv-2d6243995df5/lib/python3.7/site-packages/pep517
Proceed (y/n)? 

Analysis

I could find work on this issue before in #2552 by @takluyver and #3154 by @qwcode. I did not find what commit caused the problem to surface again.

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Aug 18, 2019
@chrahunt
Copy link
Member

Do you know if there are any versions in which this does work? I tried the versions containing those fixes but did not have any that would remove the file (of 6.0.0, 6.1.0, 7.0.0, 8.0.0, 9.0.0, 10.0.0, 18.1).

@chrahunt chrahunt added C: uninstall The logic for uninstallation of packages type: bug A confirmed bug or unintended behavior labels Aug 18, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Aug 18, 2019
@sbidoul
Copy link
Member Author

sbidoul commented Aug 18, 2019

After posting this, I confirmed #3154 does not work for the use case above.

A fix seems straightforward on the current code base (diff). But it reveals another issue: when uninstalling such symlinks, pip ends up modifying the permissions on the target directory to 0200...

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: uninstall The logic for uninstallation of packages type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants