-
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
dist_is_editable
incorrectly reports True when a non-editable dist shadows the editable
#7782
Comments
dist_is_editable
incorrectly reports True when a non-editable dist shadows the editable
I'm not sure what a fix would look like for this. At first glance I'd consider it normal to risk confusing results when installing with '-I'. |
One possibility is to also look for dist-info and egg-info when looping through |
#10249 appears to resolve this, by using |
That said, the sequence of steps described in this issue effectively leads to |
Installing a package multiple times is (unfortunately) valid in Python, and having a legacy editable install alongside with non-editable is not different from having one in system site and one in user site, from the Python interpreter’s prespective. |
Yes. The problem is that neither pkg_resources nor importlib.metadata know about these .egg-link files so we have to have some heuristic to find it. And I don't know how we could be sure to do it in the same order as the machinery that list installed distributions. So for now I will not attempt to fix this nor #10243 it in #10249. After all noboy really complains and these minor problems should fade away when PEP 660 is adopted. |
Environment
Description
I noticed this when working on #7670.
After a currently-installed editable package is force reinstalled as non-editable, the
dist_is_editable
would still report True due to the lingering.egg-link
file, creating an inconsistency, since the editable version of the package is shadowed in bothsys.path
andpkg_resources
.Expected behavior
pip should correctly report the package as non-editable.
How to Reproduce
Notice how the last
list
results included theLocation
column (suggestingsix
is editable), but the reported location (generated bypkg_resources
) points to the non-editable one. The interpreter also finds the non-editable one over the editable installation.The text was updated successfully, but these errors were encountered: