-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove additional detection of installed egg distributions when using the imporlib.metadata backend #12308
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
base: main
Are you sure you want to change the base?
Conversation
This is also not super urgent and could be deferred. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One news fragment change, but rest seems fine to me!
Thinking further about this, I'd propose to defer the removal for one year at least because
|
It’s also only until recently related issues started popping up (#12297 and IIRC there’s another one I closed). Either distributions take a lot of time to upgrade to Python 3.11, or people take a lot of time to upgrade to it. In either case, more time is likely a good idea since removing the warning would simply cause dangling files. |
The related issue has gone_in="25.1", so I changed the milestone accordingly |
This was discussed briefly here. If we don't plan on removing support for 25.1, then we need to do the following:
Alternatively, we need to resolve the conflicts here and merge it. I don't mind either way, but some action needs to happen in the next couple of weeks. The default, if no-one picks this up, is that I'll update the deprecation to say release 25.2, and we can have this same discussion in another 3 months 🙂 |
I postponed this to 26.3. Support for detecting eggs distributions has been disabled for Python >= 3.14 and the plan is to remove it for other versions when we stop supporting Python 3.10, i.e. not earlier than 26.3. |
Getting this back into 25.1, following the problems discovered in #12330 (comment) and following comments. Sorry for the noise. |
With a hack to correctly uninstall zipped egg distributions, all tests pass. |
I'll review this tomorrow, but I'm generally supportive of killing off eggs. |
I still need to update the news entry. I think I will make it a bug fix, which is we stop listing installed eggs multiple times. I'll look a little bit more, but so far I did not find any feature removed by this PR. |
The importlib.metadata backend will discover them as long as they are in sys.path, which setup.py install and easy_install do by adding them to easy-install.pth.
Discovery order depends on the metadata backend. For the importlib backend, it has changed following the previous commit, because now the .egg-link file is found while inspecting site-package, and the .egg directory is found after because it comes after in sys.path. Before the dedictated .egg detection logic was triggered while inspecting site package and found it, before looking for .egg-link.
This does not actually imply that eggs are not detected. When they are in sys.path they continue to be detected.
@pytest.mark.skipif( | ||
"sys.version_info >= (3, 14)", | ||
reason="Uninstall of .egg distributions not supported in Python 3.14+", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially thought this test failure was due to eggs not being detected with the importlib.metadata backend, but it turns out it's just a matter of the uninstallation order depending on the backend.
This should be ready, now. I recommend reviewing individual commits for easier understanding. |
I could not find the deprecation issue for this, but this was scheduled for removal in 23.3.Towards #12330