mirror of https://github.com/pypa/pip
pip list --not-required --outdated should list only outdated packages that are not dependencies of installed packages
This commit is contained in:
parent
740b1acf90
commit
4f35981085
|
@ -0,0 +1 @@
|
|||
`pip list --outdated --not-required` should list only outdated packages that are not dependencies of installed packages
|
|
@ -134,14 +134,14 @@ class ListCommand(Command):
|
|||
include_editables=options.include_editable,
|
||||
)
|
||||
|
||||
if options.not_required:
|
||||
packages = self.get_not_required(packages, options)
|
||||
|
||||
if options.outdated:
|
||||
packages = self.get_outdated(packages, options)
|
||||
elif options.uptodate:
|
||||
packages = self.get_uptodate(packages, options)
|
||||
|
||||
if options.not_required:
|
||||
packages = self.get_not_required(packages, options)
|
||||
|
||||
self.output_package_listing(packages, options)
|
||||
|
||||
def get_outdated(self, packages, options):
|
||||
|
|
|
@ -384,6 +384,22 @@ def test_outdated_editables_columns_flag(script, data):
|
|||
)
|
||||
|
||||
|
||||
@pytest.mark.network
|
||||
def test_outdated_not_required_flag(script, data):
|
||||
"""
|
||||
test the behavior of --outdated --not-required flag in the list command
|
||||
"""
|
||||
script.pip(
|
||||
'install', '-f', data.find_links, '--no-index',
|
||||
'simple==2.0', 'require_simple==1.0'
|
||||
)
|
||||
result = script.pip(
|
||||
'list', '-f', data.find_links, '--no-index', '--outdated',
|
||||
'--not-required', '--format=json',
|
||||
)
|
||||
assert [] == json.loads(result.stdout)
|
||||
|
||||
|
||||
def test_outdated_pre(script, data):
|
||||
script.pip('install', '-f', data.find_links, '--no-index', 'simple==1.0')
|
||||
|
||||
|
|
Loading…
Reference in New Issue