-
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
Remove Circular dependency between Resolver and Preparer #4636
Remove Circular dependency between Resolver and Preparer #4636
Conversation
pip/resolve.py
Outdated
self.require_hashes | ||
) | ||
|
||
# XXX: Not too sure about this. :P |
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.
What do I do about the following lines?
This reverts commit 2469633.
Note to pip committers: @pradyunsg offered to wait for PR #4644 to be committed (which was originally submitted in April and has since been approved) before committing this. |
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 |
pip/resolve.py
Outdated
# satisfied_by is only evaluated by calling _check_skip_installed, | ||
# so it must be None here. | ||
assert req.satisfied_by is None | ||
if not self.ignore_installed: |
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.
This if-check was moved into _check_skip_installed()
in my earlier PR.
pip/resolve.py
Outdated
@@ -173,6 +173,59 @@ def _check_skip_installed(self, req_to_install): | |||
self._set_req_to_reinstall(req_to_install) | |||
return None | |||
|
|||
def _get_abstract_dist_for(self, req): |
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 think it would be helpful to include a docstring stating the type of the argument and return values.
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.
Done.
FWIW, I'll be adding type comments to various parts of the codebase once the mypy PR merges.
pip/resolve.py
Outdated
self.ignore_installed | ||
) | ||
if should_modify: | ||
|
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.
Delete line.
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.
Nice catch! :)
pip/resolve.py
Outdated
) | ||
|
||
# NOTE | ||
# The following portion is for determining if a certain package is |
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.
Formatting: I would do "NOTE: the following ...."
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.
When I do it that way, I have an urge to indent the rest of the text to align with the colon, which feels like a waste of space. That's why I ended up doing this. :P
pip/resolve.py
Outdated
# This should probably get cleaned up in a future refactor. | ||
|
||
# req.req is only available after unpack for URL pkgs repeat | ||
# check_if_exists to uninstall-on-upgrade (#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.
This code comment doesn't make sense / isn't a sentence?
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 copy-pasted it. I don't want to change it as a part of this PR since I'm more concerned with moving stuff than improving things.
Thanks for the review @cjerdonek! ^.^ |
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 |
Ping! |
Ping 2.0! |
I'm not that familiar with this code, but I'll try to review it over the weekend. |
Pinging @dstufft! :) |
Note: Would conflict with #4764. :) |
I didn't say which weekend ;-) Thanks for the reminder. |
It'd be awesome if you guys could take a look at this. A summary would be cut-paste a single function from one file to another + renaming some 4 methods in all, whose signatures change to take the values that they care about (instead of the larger Resolver object that holds the references to those objects). |
I was just in the process of going to take a look when I saw the ping :-) LGTM - I assume you'll fix up #4764 after merging this? Ping me if you need a quick review on #4764 after that, but as it'll just be mechanical changes to take care of the refactoring here, I assume it'll be pretty straightforward. |
RequirementPreparer no longer takes Resolver as argument in any of its methods and directly takes the reference of the values it actually needs.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Does what it says in the title.
Sidenote: GitHub went down when I was running tests and I was totally baffled by the fact that the tests were failing.