comparison lib/python3.8/site-packages/pip/_internal/commands/check.py @ 0:9e54283cc701 draft

"planemo upload commit d12c32a45bcd441307e632fca6d9af7d60289d44"
author guerler
date Mon, 27 Jul 2020 03:47:31 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9e54283cc701
1 # The following comment should be removed at some point in the future.
2 # mypy: disallow-untyped-defs=False
3
4 import logging
5
6 from pip._internal.cli.base_command import Command
7 from pip._internal.operations.check import (
8 check_package_set,
9 create_package_set_from_installed,
10 )
11 from pip._internal.utils.misc import write_output
12
13 logger = logging.getLogger(__name__)
14
15
16 class CheckCommand(Command):
17 """Verify installed packages have compatible dependencies."""
18
19 usage = """
20 %prog [options]"""
21
22 def run(self, options, args):
23 package_set, parsing_probs = create_package_set_from_installed()
24 missing, conflicting = check_package_set(package_set)
25
26 for project_name in missing:
27 version = package_set[project_name].version
28 for dependency in missing[project_name]:
29 write_output(
30 "%s %s requires %s, which is not installed.",
31 project_name, version, dependency[0],
32 )
33
34 for project_name in conflicting:
35 version = package_set[project_name].version
36 for dep_name, dep_version, req in conflicting[project_name]:
37 write_output(
38 "%s %s has requirement %s, but you have %s %s.",
39 project_name, version, req, dep_name, dep_version,
40 )
41
42 if missing or conflicting or parsing_probs:
43 return 1
44 else:
45 write_output("No broken requirements found.")