-
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
Restrict install time dependency warnings to directly-dependant packages #5457
Restrict install time dependency warnings to directly-dependant packages #5457
Conversation
|
||
|
||
def check_package_set(package_set): | ||
# type: (PackageSet) -> CheckResult | ||
def check_package_set(package_set, whitelist=None): |
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.
Since you're only using whitelist
to check membership, it might make more sense for this to be a set
.
@@ -52,6 +56,10 @@ def check_package_set(package_set): | |||
missing_deps = set() # type: Set[Missing] | |||
conflicting_deps = set() # type: Set[Conflicting] | |||
|
|||
# Ignore dependency when it's not in the whitelist. | |||
if whitelist is not None and package_name not in whitelist: |
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.
For reasons of elegance, it would be nice if you didn't have to repeat the None
check in each iteration of the loop. An alternative to passing a list or set would be to pass a should_ignore()
function. The first couple lines of your function could then be:
if should_ignore is None:
should_ignore = lambda package_name: False
meaning your conditional would be:
if should_ignore(package_name):
continue
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!
Thanks, Pradyun! I just noticed check_package_set()’s docstring should be
updated after changing whitelist to should_ignore().
…On Thu, May 31, 2018 at 10:56 AM Dustin Ingram ***@***.***> wrote:
***@***.**** approved this pull request.
LGTM!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5457 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAVt7gbQNz3A_LLQJE7h6A7sB3AXdw_zks5t4C7WgaJpZM4US8qH>
.
|
@pypa/pip-committers I'm happy to merge this if no one else has any issues with this. |
70c2acf
to
a25e941
Compare
9c5b254
to
5842476
Compare
5842476
to
161e8bd
Compare
Merging since I am happy with this PR. :) |
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. |
This PR changes the install-time-warnings to check the consistency of just the packages to-be-installed in that run and packages that directly depend on the ones that are to-be-installed; instead of the current behavior of checking the entire package set.
This should resolve #5196.
/cc @di @cjerdonek