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

Comments

@sbidoul
Copy link
Contributor

@sbidoul 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 triage label Aug 18, 2019
@chrahunt

This comment has been minimized.

Copy link
Member

@chrahunt chrahunt commented Aug 18, 2019

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).

@sbidoul

This comment has been minimized.

Copy link
Contributor Author

@sbidoul 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 S: auto-locked 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.
Projects
None yet
2 participants
You can’t perform that action at this time.