1
- # The following comment should be removed at some point in the future.
2
- # mypy: disallow-untyped-defs=False
3
-
4
1
import logging
5
2
6
3
from pip ._internal .cli .base_command import Command
4
+ from pip ._internal .cli .status_codes import ERROR , SUCCESS
7
5
from pip ._internal .operations .check import (
8
6
check_package_set ,
9
7
create_package_set_from_installed ,
10
8
)
11
9
from pip ._internal .utils .misc import write_output
10
+ from pip ._internal .utils .typing import MYPY_CHECK_RUNNING
12
11
13
12
logger = logging .getLogger (__name__ )
14
13
14
+ if MYPY_CHECK_RUNNING :
15
+ from typing import List , Any
16
+ from optparse import Values
17
+
15
18
16
19
class CheckCommand (Command ):
17
20
"""Verify installed packages have compatible dependencies."""
@@ -20,6 +23,8 @@ class CheckCommand(Command):
20
23
%prog [options]"""
21
24
22
25
def run (self , options , args ):
26
+ # type: (Values, List[Any]) -> int
27
+
23
28
package_set , parsing_probs = create_package_set_from_installed ()
24
29
missing , conflicting = check_package_set (package_set )
25
30
@@ -40,6 +45,7 @@ def run(self, options, args):
40
45
)
41
46
42
47
if missing or conflicting or parsing_probs :
43
- return 1
48
+ return ERROR
44
49
else :
45
50
write_output ("No broken requirements found." )
51
+ return SUCCESS
0 commit comments