-
Notifications
You must be signed in to change notification settings - Fork 3k
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
uninstall doesn't remove scripts installed in 'editable' mode #5997
Comments
I can replicate this. Note that this only applies to editable requirements, and only to (Also: You likely should use Edit: I di some digging and it seems the problem is that |
This would mean the issue is on setuptools side ? |
Kind of both, I guess? setuptools needs to record installed scripts, and pip needs to use that information during uninstallation to remove them. |
Indeed, the uninstall should happen here pip/src/pip/_internal/req/req_uninstall.py Lines 383 to 391 in 5f54157
|
I require bash scripts... was under the impression that Also, I might suggest that material installed into /bin be symlinked if the install is |
This would need to be raised to setuptools instead. I don’t think it would be accepted, however, with the same reasons why the library itself is not symlinked, but using |
This avoids an issue where pip doesn't install the scripts. pypa/pip#513 pypa/pip#5997
This seems to be a problem when using console_scripts as well. Reproduce:
|
To further specify this, the problem does not appear, when installing with the consolce_scripts entrypoint in a virtual environment, only globally (with |
Strace shows us that pip tries to remove the file in the wrong location:
It tries to go via site-packages while the script is actually in /home/daan/.local/bin |
The reason for this seems to be that try:
# Use getusersitepackages if this is present, as it ensures that the
# value is initialised properly.
user_site = site.getusersitepackages()
except AttributeError:
user_site = site.USER_SITE evaluating to
|
After systemd/mkosi@0e477de, the script gets uninstalled correctly on pip uninstall mkosi. @behrmann Can you verify this as well? |
Environment
Description
installed (setuputils) package with '-e' flag. uninstalled package. package scripts remain.
Expected behavior
uninstalling package should remove package scripts.
How to Reproduce
pip install -e
which includes scripts=[] in the setup.pypip uninstall
The text was updated successfully, but these errors were encountered: