diff options
Diffstat (limited to 'src/pip/_internal/commands')
-rw-r--r-- | src/pip/_internal/commands/__init__.py | 5 | ||||
-rw-r--r-- | src/pip/_internal/commands/cache.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/check.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/completion.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/configuration.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/debug.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/download.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/freeze.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/hash.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/help.py | 5 | ||||
-rw-r--r-- | src/pip/_internal/commands/install.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/list.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/search.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/show.py | 4 | ||||
-rw-r--r-- | src/pip/_internal/commands/uninstall.py | 5 | ||||
-rw-r--r-- | src/pip/_internal/commands/wheel.py | 4 |
16 files changed, 34 insertions, 33 deletions
diff --git a/src/pip/_internal/commands/__init__.py b/src/pip/_internal/commands/__init__.py index f2411201c..3037e9da8 100644 --- a/src/pip/_internal/commands/__init__.py +++ b/src/pip/_internal/commands/__init__.py @@ -4,10 +4,9 @@ Package containing all pip commands import importlib from collections import OrderedDict, namedtuple +from typing import TYPE_CHECKING -from pip._internal.utils.typing import MYPY_CHECK_RUNNING - -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from typing import Any, Optional from pip._internal.cli.base_command import Command diff --git a/src/pip/_internal/commands/cache.py b/src/pip/_internal/commands/cache.py index d5ac45ad7..4f746dd98 100644 --- a/src/pip/_internal/commands/cache.py +++ b/src/pip/_internal/commands/cache.py @@ -1,14 +1,14 @@ import logging import os import textwrap +from typing import TYPE_CHECKING import pip._internal.utils.filesystem as filesystem from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.exceptions import CommandError, PipError -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Any, List diff --git a/src/pip/_internal/commands/check.py b/src/pip/_internal/commands/check.py index e066bb63c..5bc07cb7e 100644 --- a/src/pip/_internal/commands/check.py +++ b/src/pip/_internal/commands/check.py @@ -1,4 +1,5 @@ import logging +from typing import TYPE_CHECKING from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS @@ -7,11 +8,10 @@ from pip._internal.operations.check import ( create_package_set_from_installed, ) from pip._internal.utils.misc import write_output -from pip._internal.utils.typing import MYPY_CHECK_RUNNING logger = logging.getLogger(__name__) -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Any, List diff --git a/src/pip/_internal/commands/completion.py b/src/pip/_internal/commands/completion.py index 2c19d5686..ca3360752 100644 --- a/src/pip/_internal/commands/completion.py +++ b/src/pip/_internal/commands/completion.py @@ -1,12 +1,12 @@ import sys import textwrap +from typing import TYPE_CHECKING from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.utils.misc import get_prog -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py index a440a2b17..8cf034aaf 100644 --- a/src/pip/_internal/commands/configuration.py +++ b/src/pip/_internal/commands/configuration.py @@ -1,6 +1,7 @@ import logging import os import subprocess +from typing import TYPE_CHECKING from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS @@ -8,9 +9,8 @@ from pip._internal.configuration import Configuration, get_configuration_files, from pip._internal.exceptions import PipError from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import get_prog, write_output -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Any, List, Optional diff --git a/src/pip/_internal/commands/debug.py b/src/pip/_internal/commands/debug.py index c1af3630e..15c66fd53 100644 --- a/src/pip/_internal/commands/debug.py +++ b/src/pip/_internal/commands/debug.py @@ -2,6 +2,7 @@ import locale import logging import os import sys +from typing import TYPE_CHECKING import pip._vendor from pip._vendor.certifi import where @@ -15,9 +16,8 @@ from pip._internal.cli.status_codes import SUCCESS from pip._internal.metadata import get_environment from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import get_pip_version -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from types import ModuleType from typing import Dict, List, Optional diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py index 0f09fcc0e..212b75c7a 100644 --- a/src/pip/_internal/commands/download.py +++ b/src/pip/_internal/commands/download.py @@ -1,5 +1,6 @@ import logging import os +from typing import TYPE_CHECKING from pip._internal.cli import cmdoptions from pip._internal.cli.cmdoptions import make_target_python @@ -8,9 +9,8 @@ from pip._internal.cli.status_codes import SUCCESS from pip._internal.req.req_tracker import get_requirement_tracker from pip._internal.utils.misc import ensure_dir, normalize_path, write_output from pip._internal.utils.temp_dir import TempDirectory -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/freeze.py b/src/pip/_internal/commands/freeze.py index bf20db6c3..6a3288d6b 100644 --- a/src/pip/_internal/commands/freeze.py +++ b/src/pip/_internal/commands/freeze.py @@ -1,4 +1,5 @@ import sys +from typing import TYPE_CHECKING from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Command @@ -6,11 +7,10 @@ from pip._internal.cli.status_codes import SUCCESS from pip._internal.operations.freeze import freeze from pip._internal.utils.compat import stdlib_pkgs from pip._internal.utils.deprecation import deprecated -from pip._internal.utils.typing import MYPY_CHECK_RUNNING DEV_PKGS = {'pip', 'setuptools', 'distribute', 'wheel'} -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/hash.py b/src/pip/_internal/commands/hash.py index db68f6ce7..ff871b806 100644 --- a/src/pip/_internal/commands/hash.py +++ b/src/pip/_internal/commands/hash.py @@ -1,14 +1,14 @@ import hashlib import logging import sys +from typing import TYPE_CHECKING from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES from pip._internal.utils.misc import read_chunks, write_output -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/help.py b/src/pip/_internal/commands/help.py index 8372ac615..0e1dc81ff 100644 --- a/src/pip/_internal/commands/help.py +++ b/src/pip/_internal/commands/help.py @@ -1,9 +1,10 @@ +from typing import TYPE_CHECKING + from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.exceptions import CommandError -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index e303adf86..a6989a0f8 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -5,6 +5,7 @@ import os import shutil import site from optparse import SUPPRESS_HELP +from typing import TYPE_CHECKING from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name @@ -29,11 +30,10 @@ from pip._internal.utils.misc import ( write_output, ) from pip._internal.utils.temp_dir import TempDirectory -from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.virtualenv import virtualenv_no_global from pip._internal.wheel_builder import build, should_build_for_install_command -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Iterable, List, Optional diff --git a/src/pip/_internal/commands/list.py b/src/pip/_internal/commands/list.py index 89cfb625e..4ee0d54b4 100644 --- a/src/pip/_internal/commands/list.py +++ b/src/pip/_internal/commands/list.py @@ -1,5 +1,6 @@ import json import logging +from typing import TYPE_CHECKING from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import IndexGroupCommand @@ -17,9 +18,8 @@ from pip._internal.utils.misc import ( ) from pip._internal.utils.packaging import get_installer from pip._internal.utils.parallel import map_multithread -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Iterator, List, Set, Tuple diff --git a/src/pip/_internal/commands/search.py b/src/pip/_internal/commands/search.py index 90a5b512d..1c7fa74ae 100644 --- a/src/pip/_internal/commands/search.py +++ b/src/pip/_internal/commands/search.py @@ -3,6 +3,7 @@ import shutil import sys import textwrap from collections import OrderedDict +from typing import TYPE_CHECKING from pip._vendor.packaging.version import parse as parse_version @@ -19,9 +20,8 @@ from pip._internal.models.index import PyPI from pip._internal.network.xmlrpc import PipXmlrpcTransport from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import write_output -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Dict, List, Optional diff --git a/src/pip/_internal/commands/show.py b/src/pip/_internal/commands/show.py index a6363cfd0..e4d250290 100644 --- a/src/pip/_internal/commands/show.py +++ b/src/pip/_internal/commands/show.py @@ -1,6 +1,7 @@ import logging import os from email.parser import FeedParser +from typing import TYPE_CHECKING from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name @@ -8,9 +9,8 @@ from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.utils.misc import write_output -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import Dict, Iterator, List diff --git a/src/pip/_internal/commands/uninstall.py b/src/pip/_internal/commands/uninstall.py index 6dc96c3d6..5084f32d2 100644 --- a/src/pip/_internal/commands/uninstall.py +++ b/src/pip/_internal/commands/uninstall.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli.base_command import Command @@ -10,9 +12,8 @@ from pip._internal.req.constructors import ( install_req_from_parsed_requirement, ) from pip._internal.utils.misc import protect_pip_from_modification_on_windows -from pip._internal.utils.typing import MYPY_CHECK_RUNNING -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py index 28918fa74..d97ac00c4 100644 --- a/src/pip/_internal/commands/wheel.py +++ b/src/pip/_internal/commands/wheel.py @@ -1,6 +1,7 @@ import logging import os import shutil +from typing import TYPE_CHECKING from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions @@ -10,10 +11,9 @@ from pip._internal.exceptions import CommandError from pip._internal.req.req_tracker import get_requirement_tracker from pip._internal.utils.misc import ensure_dir, normalize_path from pip._internal.utils.temp_dir import TempDirectory -from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.wheel_builder import build, should_build_for_wheel_command -if MYPY_CHECK_RUNNING: +if TYPE_CHECKING: from optparse import Values from typing import List |