-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pip list --not-required --outdated should list only outdated packages… #6116
pip list --not-required --outdated should list only outdated packages… #6116
Conversation
… that are not dependencies of installed packages
dcccea6
to
4f35981
Compare
tests/functional/test_list.py
Outdated
@@ -384,6 +384,22 @@ def test_outdated_editables_columns_flag(script, data): | |||
) | |||
|
|||
|
|||
@pytest.mark.network |
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 are using --no-index
option, this mark should not be necessary.
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.
ok
@@ -134,14 +134,14 @@ def run(self, options, args): | |||
include_editables=options.include_editable, | |||
) | |||
|
|||
if options.not_required: | |||
packages = self.get_not_required(packages, options) |
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.
Maybe add a comment explaining why this should stay before the other filter operations.
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.
Thanks for comments. The explanation added.
Thanks for the 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 solves #5737. Filtering out of not-required packages should be done before getting outdated here:
pip/src/pip/_internal/commands/list.py
Lines 136 to 144 in 740b1ac
Current behaviour, for example: Outdated package B is required by up-to-date package A. The list of outdated packages passed to
self.get_not_required
contains only package B. Therefore package B is not detected as the requirement of any other package in the list and therefore is not considered as dependency.