mirror of https://github.com/pypa/pip
Rename --no-deps-only to --not-required.
This commit is contained in:
parent
bb896cb44c
commit
88d2bd8165
|
@ -14,7 +14,7 @@
|
|||
|
||||
* Added optional column formatting to ``pip list`` (:issue:`3651`).
|
||||
|
||||
* Add `--no-deps-only` option to ``pip list`` to list packages that are
|
||||
* Add `--not-required` option to ``pip list`` to list packages that are
|
||||
not dependencies of other packages.
|
||||
|
||||
* Fix the build on systems with symlinked /tmp directory for custom
|
||||
|
|
|
@ -71,7 +71,7 @@ Examples
|
|||
|
||||
::
|
||||
|
||||
$ pip list --outdated --no-deps-only
|
||||
$ pip list --outdated --not-required
|
||||
docutils (Current: 0.10 Latest: 0.11)
|
||||
|
||||
#. Use legacy formatting
|
||||
|
|
|
@ -92,9 +92,9 @@ class ListCommand(Command):
|
|||
)
|
||||
|
||||
cmd_opts.add_option(
|
||||
'--no-deps-only',
|
||||
'--not-required',
|
||||
action='store_true',
|
||||
dest='nodeps_only',
|
||||
dest='not_required',
|
||||
help="List packages that are not dependencies of "
|
||||
"installed packages.",
|
||||
)
|
||||
|
@ -165,8 +165,8 @@ class ListCommand(Command):
|
|||
elif options.uptodate:
|
||||
packages = self.get_uptodate(packages, options)
|
||||
|
||||
if options.nodeps_only:
|
||||
packages = self.get_nodeps_only(packages, options)
|
||||
if options.not_required:
|
||||
packages = self.get_not_required(packages, options)
|
||||
|
||||
self.output_package_listing(packages, options)
|
||||
|
||||
|
@ -182,7 +182,7 @@ class ListCommand(Command):
|
|||
if dist.latest_version == dist.parsed_version
|
||||
]
|
||||
|
||||
def get_nodeps_only(self, packages, options):
|
||||
def get_not_required(self, packages, options):
|
||||
dep_keys = set()
|
||||
for dist in packages:
|
||||
dep_keys.update(requirement.key for requirement in dist.requires())
|
||||
|
|
|
@ -564,11 +564,11 @@ def test_outdated_formats(script, data):
|
|||
'latest_version': '1.1', 'latest_filetype': 'wheel'}]
|
||||
|
||||
|
||||
def test_no_deps_only_flag(script, data):
|
||||
def test_not_required_flag(script, data):
|
||||
script.pip(
|
||||
'install', '-f', data.find_links, '--no-index', 'TopoRequires4'
|
||||
)
|
||||
result = script.pip('list', '--no-deps-only', expect_stderr=True)
|
||||
result = script.pip('list', '--not-required', expect_stderr=True)
|
||||
assert 'TopoRequires4 ' in result.stdout, str(result)
|
||||
assert 'TopoRequires ' not in result.stdout
|
||||
assert 'TopoRequires2 ' not in result.stdout
|
||||
|
|
Loading…
Reference in New Issue