mirror of https://github.com/pypa/pip
Add --no-deps-only option to CHANGES.txt and fix lint warnings.
This commit is contained in:
parent
e0b23e9ce3
commit
60429a6e79
|
@ -14,6 +14,9 @@
|
|||
|
||||
* Added optional column formatting to ``pip list`` (:issue:`3651`).
|
||||
|
||||
* Add `--no-deps-only` 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
|
||||
builds such as numpy.
|
||||
|
||||
|
|
|
@ -95,7 +95,8 @@ class ListCommand(Command):
|
|||
'--no-deps-only',
|
||||
action='store_true',
|
||||
dest='nodeps_only',
|
||||
help="List packages that are not dependencies of installed packages.",
|
||||
help="List packages that are not dependencies of "
|
||||
"installed packages.",
|
||||
)
|
||||
|
||||
index_opts = make_option_group(index_group, self.parser)
|
||||
|
@ -182,12 +183,13 @@ class ListCommand(Command):
|
|||
]
|
||||
|
||||
def get_nodeps_only(self, packages, options):
|
||||
installed_packages = [
|
||||
dist for dist in self.iter_packages_latest_infos(packages, options)]
|
||||
installed_pkgs = [
|
||||
dist for dist in self.iter_packages_latest_infos(packages, options)
|
||||
]
|
||||
dep_keys = set()
|
||||
for dist in installed_packages:
|
||||
for dist in installed_pkgs:
|
||||
dep_keys.update(requirement.key for requirement in dist.requires())
|
||||
return set(pkg for pkg in installed_packages if pkg.key not in dep_keys)
|
||||
return set(pkg for pkg in installed_pkgs if pkg.key not in dep_keys)
|
||||
|
||||
def iter_packages_latest_infos(self, packages, options):
|
||||
index_urls = [options.index_url] + options.extra_index_urls
|
||||
|
|
Loading…
Reference in New Issue