summaryrefslogtreecommitdiff
path: root/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py
diff options
context:
space:
mode:
authorShubham Saini <shubham6405@gmail.com>2018-12-11 10:01:23 +0000
committerShubham Saini <shubham6405@gmail.com>2018-12-11 10:01:23 +0000
commit68df54d6629ec019142eb149dd037774f2d11e7c (patch)
tree345bc22d46b4e01a4ba8303b94278952a4ed2b9e /venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py
First commit
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py')
-rw-r--r--venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py
new file mode 100644
index 0000000..b1bf38a
--- /dev/null
+++ b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/check.py
@@ -0,0 +1,42 @@
1import logging
2
3from pip._internal.basecommand import Command
4from pip._internal.operations.check import (
5 check_package_set, create_package_set_from_installed,
6)
7from pip._internal.utils.misc import get_installed_distributions
8
9logger = logging.getLogger(__name__)
10
11
12class CheckCommand(Command):
13 """Verify installed packages have compatible dependencies."""
14 name = 'check'
15 usage = """
16 %prog [options]"""
17 summary = 'Verify installed packages have compatible dependencies.'
18
19 def run(self, options, args):
20 package_set = create_package_set_from_installed()
21 missing, conflicting = check_package_set(package_set)
22
23 for project_name in missing:
24 version = package_set[project_name].version
25 for dependency in missing[project_name]:
26 logger.info(
27 "%s %s requires %s, which is not installed.",
28 project_name, version, dependency[0],
29 )
30
31 for project_name in conflicting:
32 version = package_set[project_name].version
33 for dep_name, dep_version, req in conflicting[project_name]:
34 logger.info(
35 "%s %s has requirement %s, but you have %s %s.",
36 project_name, version, req, dep_name, dep_version,
37 )
38
39 if missing or conflicting:
40 return 1
41 else:
42 logger.info("No broken requirements found.")