-
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
Reduce action at distance #4978
Merged
pradyunsg
merged 7 commits into
pypa:master
from
pradyunsg:refactor/reduce-action-at-distance
Mar 30, 2018
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
de7d42f
Reduce classes with use_user_site attribute
pradyunsg b1cb27d
Reduce classes with target_dir attribute
pradyunsg 01c985a
Reduce classes with pycompile attribute
pradyunsg 055dcb8
Assign is_direct outside RequirementSet
pradyunsg 146c390
Update unit tests for the changes
pradyunsg 255a518
Merge branch 'master' into refactor/reduce-action-at-distance
pradyunsg c2a4ea4
Merge branch 'master' into refactor/reduce-action-at-distance
pradyunsg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,7 @@ def _check_skip_installed(self, req_to_install): | |
if self.ignore_installed: | ||
return None | ||
|
||
req_to_install.check_if_exists() | ||
req_to_install.check_if_exists(self.use_user_site) | ||
if not req_to_install.satisfied_by: | ||
return None | ||
|
||
|
@@ -187,9 +187,8 @@ def _get_abstract_dist_for(self, req): | |
|
||
if req.editable: | ||
return self.preparer.prepare_editable_requirement( | ||
req, | ||
self.require_hashes, | ||
self.finder, | ||
req, self.require_hashes, self.use_user_site, self.finder, | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this empty line. |
||
) | ||
|
||
# satisfied_by is only evaluated by calling _check_skip_installed, | ||
|
@@ -217,7 +216,7 @@ def _get_abstract_dist_for(self, req): | |
# pkgs repeat check_if_exists to uninstall-on-upgrade | ||
# (#14) | ||
if not self.ignore_installed: | ||
req.check_if_exists() | ||
req.check_if_exists(self.use_user_site) | ||
|
||
if req.satisfied_by: | ||
should_modify = ( | ||
|
@@ -285,6 +284,7 @@ def add_req(subreq, extras_requested): | |
# can refer to it when adding dependencies. | ||
if not requirement_set.has_requirement(req_to_install.name): | ||
# 'unnamed' requirements will get added here | ||
req_to_install.is_direct = True | ||
requirement_set.add_requirement(req_to_install, None) | ||
|
||
if not self.ignore_dependencies: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way.
This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here.
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.
Yeah, I think I need to see the whole file - github's review interface isn't that great for changes like this.
OTOH, if the tests pass, and you're happy that the code is easier to maintain, I don't really have a problem with it going in. Feel free to merge it without me going through it in detail, if you want.