-
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
Basic skeleton to start pkg_resources migration #8114
Conversation
d4f5bda
to
5e30b49
Compare
Thank you for this. I think this will help one of my PRs #8054 as well (also pointed out in #8054 (comment)) Should I should hold on to making changes to that PR until this gets matured and merged? |
I think it works either way. |
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.
LGTM!
5e30b49
to
5266d78
Compare
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
5266d78
to
5be65bc
Compare
5be65bc
to
8596d90
Compare
Rebased to include changes from #8054. I chose to keep |
a6c172e
to
6072de9
Compare
d41b59f
to
3f1cdd3
Compare
Maybe we should add this as a comment in the code, to guide future maintainers in refactoring? A note in an issue comment is likely to get forgotten, whereas a note in the code won't. |
fef276c
to
1fa6ebd
Compare
Good idea, I added the following comment to both functions:
|
3fbd3a8
to
48aaf00
Compare
This seems to rebase cleanly to master, hopefully the test suite agrees. I want to get this merged soon and start working on the transition. The plan is to push this out for Python 3 in the 20.3 release (but keeping the old implementation in |
So obviously that didn’t happen. Since we’ll want 21.0 to be a minimal change release, I’m adding this to 21.1, which should be plenty of time to get this worked into a mergable state. |
1fd8d71
to
0491b79
Compare
Note for future self. With python/importlib_metadata#111 resolved, pip should have all the needed parts to remove for path in MetadataPathFinder._search_paths(name, search_paths):
distribution = PathDistribution(path) # Build a distribution class at `path` for inspection. The |
ad7f93a
to
8d40580
Compare
6f7ee06
to
e93d83e
Compare
pkg_resources performs annoying caching that needs to be worked around in some parts of pip. This makes it easier to represent the difference between environments backend by WorkingSet() and working_set.
e93d83e
to
11e37aa
Compare
From #9540:
I'm not sure what "good timing" you want here, this has no conflicts and 2 approvals so IMO, it's good to go. I'm grateful you didn't land it just before 21.0 (and even more so that you didn't land it between 21.0 and 21.0.1!) but I think the 21.0 cycle is more or less done now. Let's wait a week in case anyone screams about 21.0.1, but unless they do, I'd say you can merge this any time from then. |
At this point, a couple of more days to make sure 21.0.1 does not contain catastrophic issues that require an emergency release. |
A few weekdays have passed and I think it’s safe to assume the 21.0 release if free of major issues. I’ll merge this later today and start working on migration. |
This implements the basic shim structure I mentioned in #7413 (comment). I moved the
lru_cache()
shim toutils.compat
since it’s useful forget_environment()
.One very trivial change is made in
self_outed_check
to demostrate how the end result would look like in essence.I think (hope?) this would be enough for someone to run with the idea and start refactoring. I think the logical next refactor would be to change
AbstractDistribution
to returnBaseDistribution
instead, and modify the prepare code. After that, usages in the new resolver can switch.