mirror of https://github.com/pypa/pip
Merge pull request #8902 from pradyunsg/linter-updates
This commit is contained in:
commit
faee60baea
|
@ -2,7 +2,7 @@ exclude: 'src/pip/_vendor/'
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.5.0
|
rev: v3.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-builtin-literals
|
- id: check-builtin-literals
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
|
@ -17,7 +17,7 @@ repos:
|
||||||
exclude: .patch
|
exclude: .patch
|
||||||
|
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
rev: 3.8.1
|
rev: 3.8.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies: [
|
additional_dependencies: [
|
||||||
|
@ -27,7 +27,7 @@ repos:
|
||||||
exclude: tests/data
|
exclude: tests/data
|
||||||
|
|
||||||
- repo: https://github.com/timothycrosley/isort
|
- repo: https://github.com/timothycrosley/isort
|
||||||
rev: 4.3.21
|
rev: 5.5.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
files: \.py$
|
files: \.py$
|
||||||
|
@ -44,7 +44,7 @@ repos:
|
||||||
args: ["--pretty", "-2"]
|
args: ["--pretty", "-2"]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||||
rev: v1.5.1
|
rev: v1.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: python-no-log-warn
|
- id: python-no-log-warn
|
||||||
- id: python-no-eval
|
- id: python-no-eval
|
||||||
|
@ -56,6 +56,6 @@ repos:
|
||||||
exclude: NEWS.rst
|
exclude: NEWS.rst
|
||||||
|
|
||||||
- repo: https://github.com/mgedmin/check-manifest
|
- repo: https://github.com/mgedmin/check-manifest
|
||||||
rev: '0.42'
|
rev: '0.43'
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-manifest
|
- id: check-manifest
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ The big change in this release is to the pip dependency resolver
|
||||||
within pip.
|
within pip.
|
||||||
|
|
||||||
Computers need to know the right order to install pieces of software
|
Computers need to know the right order to install pieces of software
|
||||||
("to install `x`, you need to install `y` first"). So, when Python
|
("to install ``x``, you need to install ``y`` first"). So, when Python
|
||||||
programmers share software as packages, they have to precisely describe
|
programmers share software as packages, they have to precisely describe
|
||||||
those installation prerequisites, and pip needs to navigate tricky
|
those installation prerequisites, and pip needs to navigate tricky
|
||||||
situations where it's getting conflicting instructions. This new
|
situations where it's getting conflicting instructions. This new
|
||||||
|
|
|
@ -2,7 +2,7 @@ import pip._internal.utils.inject_securetransport # noqa
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, List
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
|
|
|
@ -19,7 +19,8 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import Tuple, Set, Iterable, Optional, List, Type
|
from typing import Iterable, List, Optional, Set, Tuple, Type
|
||||||
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -17,7 +17,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.urls import path_to_url
|
from pip._internal.utils.urls import path_to_url
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Set, List, Any, Dict
|
from typing import Any, Dict, List, Optional, Set
|
||||||
|
|
||||||
from pip._vendor.packaging.tags import Tag
|
from pip._vendor.packaging.tags import Tag
|
||||||
|
|
||||||
|
|
|
@ -43,12 +43,11 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.virtualenv import running_under_virtualenv
|
from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Optional, Tuple, Any
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from typing import Any, List, Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.utils.temp_dir import (
|
from pip._internal.utils.temp_dir import \
|
||||||
TempDirectoryTypeRegistry as TempDirRegistry
|
TempDirectoryTypeRegistry as TempDirRegistry
|
||||||
)
|
|
||||||
|
|
||||||
__all__ = ['Command']
|
__all__ = ['Command']
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,9 @@ from pip._internal.utils.hashes import STRONG_HASHES
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Any, Callable, Dict, Optional, Tuple
|
|
||||||
from optparse import OptionParser, Values
|
from optparse import OptionParser, Values
|
||||||
|
from typing import Any, Callable, Dict, Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.cli.parser import ConfigOptionParser
|
from pip._internal.cli.parser import ConfigOptionParser
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from pip._vendor.contextlib2 import ExitStack
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Iterator, ContextManager, TypeVar
|
from typing import ContextManager, Iterator, TypeVar
|
||||||
|
|
||||||
_T = TypeVar('_T', covariant=True)
|
_T = TypeVar('_T', covariant=True)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ from pip._internal.utils.misc import get_pip_version, get_prog
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Tuple, List
|
from typing import List, Tuple
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["create_main_parser", "parse_command"]
|
__all__ = ["create_main_parser", "parse_command"]
|
||||||
|
|
|
@ -13,7 +13,7 @@ from pip._internal.utils.logging import get_indentation
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Iterator, IO
|
from typing import IO, Iterator
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pip._internal.cli.base_command import Command
|
from pip._internal.cli.base_command import Command
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Any
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from typing import Any, List
|
||||||
|
|
||||||
|
|
||||||
class CheckCommand(Command):
|
class CheckCommand(Command):
|
||||||
|
|
|
@ -9,8 +9,8 @@ from pip._internal.utils.misc import get_prog
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from typing import List
|
||||||
|
|
||||||
BASE_COMPLETION = """
|
BASE_COMPLETION = """
|
||||||
# pip {shell} completion start{script}# pip {shell} completion end
|
# pip {shell} completion start{script}# pip {shell} completion end
|
||||||
|
|
|
@ -15,8 +15,8 @@ from pip._internal.utils.misc import get_prog, write_output
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Any, Optional
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
from pip._internal.configuration import Kind
|
from pip._internal.configuration import Kind
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,10 @@ from pip._internal.utils.misc import get_pip_version
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from types import ModuleType
|
|
||||||
from typing import List, Optional, Dict
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from types import ModuleType
|
||||||
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from pip._internal.configuration import Configuration
|
from pip._internal.configuration import Configuration
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -6,8 +6,8 @@ from pip._internal.exceptions import CommandError
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List
|
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
class HelpCommand(Command):
|
class HelpCommand(Command):
|
||||||
|
@ -20,7 +20,9 @@ class HelpCommand(Command):
|
||||||
def run(self, options, args):
|
def run(self, options, args):
|
||||||
# type: (Values, List[str]) -> int
|
# type: (Values, List[str]) -> int
|
||||||
from pip._internal.commands import (
|
from pip._internal.commands import (
|
||||||
commands_dict, create_command, get_similar_commands,
|
commands_dict,
|
||||||
|
create_command,
|
||||||
|
get_similar_commands,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -24,10 +24,11 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import List, Set, Tuple, Iterator
|
from typing import Iterator, List, Set, Tuple
|
||||||
|
|
||||||
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
from pip._internal.network.session import PipSession
|
from pip._internal.network.session import PipSession
|
||||||
from pip._vendor.pkg_resources import Distribution
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import List, Dict, Optional
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
TransformedHit = TypedDict(
|
TransformedHit = TypedDict(
|
||||||
'TransformedHit',
|
'TransformedHit',
|
||||||
|
|
|
@ -14,7 +14,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import List, Dict, Iterator
|
from typing import Dict, Iterator, List
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,7 @@ from pip._internal.utils.misc import ensure_dir, enum
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Dict, Iterable, List, NewType, Optional, Tuple
|
||||||
Any, Dict, Iterable, List, NewType, Optional, Tuple
|
|
||||||
)
|
|
||||||
|
|
||||||
RawConfigParser = configparser.RawConfigParser # Shorthand
|
RawConfigParser = configparser.RawConfigParser # Shorthand
|
||||||
Kind = NewType("Kind", str)
|
Kind = NewType("Kind", str)
|
||||||
|
|
|
@ -8,8 +8,9 @@ if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
from pip._internal.req import InstallRequirement
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
from pip._internal.req import InstallRequirement
|
||||||
|
|
||||||
|
|
||||||
@add_metaclass(abc.ABCMeta)
|
@add_metaclass(abc.ABCMeta)
|
||||||
|
|
|
@ -5,6 +5,7 @@ if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ if MYPY_CHECK_RUNNING:
|
||||||
from typing import Set, Tuple
|
from typing import Set, Tuple
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ from pip._vendor.six import iteritems
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Any, Optional, List, Dict, Text
|
from typing import Any, Dict, List, Optional, Text
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
from pip._vendor.requests.models import Response, Request
|
from pip._vendor.requests.models import Request, Response
|
||||||
from pip._vendor.six import PY3
|
from pip._vendor.six import PY3
|
||||||
from pip._vendor.six.moves import configparser
|
from pip._vendor.six.moves import configparser
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,20 @@ from pip._internal.utils.urls import path_to_url, url_to_path
|
||||||
from pip._internal.vcs import is_url, vcs
|
from pip._internal.vcs import is_url, vcs
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
|
import xml.etree.ElementTree
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import (
|
from typing import (
|
||||||
Callable, Iterable, List, MutableMapping, Optional,
|
Callable,
|
||||||
Protocol, Sequence, Tuple, TypeVar, Union,
|
Iterable,
|
||||||
|
List,
|
||||||
|
MutableMapping,
|
||||||
|
Optional,
|
||||||
|
Protocol,
|
||||||
|
Sequence,
|
||||||
|
Tuple,
|
||||||
|
TypeVar,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
import xml.etree.ElementTree
|
|
||||||
|
|
||||||
from pip._vendor.requests import Response
|
from pip._vendor.requests import Response
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,14 @@ from pip._internal.utils.urls import url_to_path
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
FrozenSet, Iterable, List, Optional, Set, Text, Tuple, Union,
|
FrozenSet,
|
||||||
|
Iterable,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Set,
|
||||||
|
Text,
|
||||||
|
Tuple,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
from pip._vendor.packaging.tags import Tag
|
from pip._vendor.packaging.tags import Tag
|
||||||
|
|
|
@ -22,9 +22,8 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING, cast
|
||||||
from pip._internal.utils.virtualenv import running_under_virtualenv
|
from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Dict, List, Optional, Union
|
|
||||||
|
|
||||||
from distutils.cmd import Command as DistutilsCommand
|
from distutils.cmd import Command as DistutilsCommand
|
||||||
|
from typing import Dict, List, Optional, Union
|
||||||
|
|
||||||
|
|
||||||
# Application Directories
|
# Application Directories
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, List
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
|
|
|
@ -5,6 +5,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from pip._vendor.packaging.version import _BaseVersion
|
from pip._vendor.packaging.version import _BaseVersion
|
||||||
|
|
||||||
from pip._internal.models.link import Link
|
from pip._internal.models.link import Link
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,7 @@ from pip._vendor.six.moves.urllib import parse as urllib_parse
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Dict, Iterable, Optional, Type, TypeVar, Union
|
||||||
Any, Dict, Iterable, Optional, Type, TypeVar, Union
|
|
||||||
)
|
|
||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pip._internal.exceptions import CommandError
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Set, FrozenSet
|
from typing import FrozenSet, Optional, Set
|
||||||
|
|
||||||
|
|
||||||
class FormatControl(object):
|
class FormatControl(object):
|
||||||
|
|
|
@ -16,6 +16,7 @@ from pip._internal.utils.urls import path_to_url, url_to_path
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Text, Tuple, Union
|
from typing import Optional, Text, Tuple, Union
|
||||||
|
|
||||||
from pip._internal.index.collector import HTMLPage
|
from pip._internal.index.collector import HTMLPage
|
||||||
from pip._internal.utils.hashes import Hashes
|
from pip._internal.utils.hashes import Hashes
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pip._internal.models.format_control import FormatControl
|
from pip._internal.models.format_control import FormatControl
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,12 @@ from pip._internal.utils.misc import (
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Dict, Optional, Tuple, List, Any
|
from typing import Any, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
|
from pip._vendor.requests.models import Request, Response
|
||||||
|
|
||||||
from pip._internal.vcs.versioncontrol import AuthInfo
|
from pip._internal.vcs.versioncontrol import AuthInfo
|
||||||
|
|
||||||
from pip._vendor.requests.models import Response, Request
|
|
||||||
|
|
||||||
Credentials = Tuple[str, str, str]
|
Credentials = Tuple[str, str, str]
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -13,7 +13,7 @@ from pip._internal.utils.misc import ensure_dir
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Iterator
|
from typing import Iterator, Optional
|
||||||
|
|
||||||
|
|
||||||
def is_from_cache(response):
|
def is_from_cache(response):
|
||||||
|
|
|
@ -37,9 +37,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.urls import url_to_path
|
from pip._internal.utils.urls import url_to_path
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Iterator, List, Optional, Tuple, Union
|
||||||
Iterator, List, Optional, Tuple, Union,
|
|
||||||
)
|
|
||||||
|
|
||||||
from pip._internal.models.link import Link
|
from pip._internal.models.link import Link
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from pip._internal.network.session import PipSession
|
from pip._internal.network.session import PipSession
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,10 @@ from pip._internal.utils.temp_dir import TempDirectory
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from pip._internal.build_env import BuildEnvironment
|
|
||||||
from pip._vendor.pep517.wrappers import Pep517HookCaller
|
from pip._vendor.pep517.wrappers import Pep517HookCaller
|
||||||
|
|
||||||
|
from pip._internal.build_env import BuildEnvironment
|
||||||
|
|
||||||
|
|
||||||
def generate_metadata(build_env, backend):
|
def generate_metadata(build_env, backend):
|
||||||
# type: (BuildEnvironment, Pep517HookCaller) -> str
|
# type: (BuildEnvironment, Pep517HookCaller) -> str
|
||||||
|
|
|
@ -6,6 +6,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from pip._vendor.pep517.wrappers import Pep517HookCaller
|
from pip._vendor.pep517.wrappers import Pep517HookCaller
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -16,10 +16,9 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
|
||||||
|
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
from typing import (
|
|
||||||
Any, Callable, Dict, Optional, Set, Tuple, List
|
|
||||||
)
|
|
||||||
|
|
||||||
# Shorthands
|
# Shorthands
|
||||||
PackageSet = Dict[str, 'PackageDetails']
|
PackageSet = Dict[str, 'PackageDetails']
|
||||||
|
|
|
@ -26,12 +26,20 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
Iterator, Optional, List, Container, Set, Dict, Tuple, Iterable, Union
|
Container,
|
||||||
|
Dict,
|
||||||
|
Iterable,
|
||||||
|
Iterator,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Set,
|
||||||
|
Tuple,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from pip._vendor.pkg_resources import Distribution, Requirement
|
||||||
|
|
||||||
from pip._internal.cache import WheelCache
|
from pip._internal.cache import WheelCache
|
||||||
from pip._vendor.pkg_resources import (
|
|
||||||
Distribution, Requirement
|
|
||||||
)
|
|
||||||
|
|
||||||
RequirementInfo = Tuple[Optional[Union[str, Requirement]], bool, List[str]]
|
RequirementInfo = Tuple[Optional[Union[str, Requirement]], bool, List[str]]
|
||||||
|
|
||||||
|
@ -183,7 +191,7 @@ def get_requirement_info(dist):
|
||||||
|
|
||||||
location = os.path.normcase(os.path.abspath(dist.location))
|
location = os.path.normcase(os.path.abspath(dist.location))
|
||||||
|
|
||||||
from pip._internal.vcs import vcs, RemoteNotFoundError
|
from pip._internal.vcs import RemoteNotFoundError, vcs
|
||||||
vcs_backend = vcs.get_backend_for_dir(location)
|
vcs_backend = vcs.get_backend_for_dir(location)
|
||||||
|
|
||||||
if vcs_backend is None:
|
if vcs_backend is None:
|
||||||
|
|
|
@ -62,10 +62,10 @@ if not MYPY_CHECK_RUNNING:
|
||||||
else:
|
else:
|
||||||
from email.message import Message
|
from email.message import Message
|
||||||
from typing import (
|
from typing import (
|
||||||
|
IO,
|
||||||
Any,
|
Any,
|
||||||
Callable,
|
Callable,
|
||||||
Dict,
|
Dict,
|
||||||
IO,
|
|
||||||
Iterable,
|
Iterable,
|
||||||
Iterator,
|
Iterator,
|
||||||
List,
|
List,
|
||||||
|
|
|
@ -12,7 +12,7 @@ from pip._internal.exceptions import InstallationError
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Any, Optional, List
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
|
|
||||||
def _is_list_of_str(obj):
|
def _is_list_of_str(obj):
|
||||||
|
|
|
@ -31,9 +31,8 @@ from pip._internal.utils.urls import path_to_url
|
||||||
from pip._internal.vcs import is_url, vcs
|
from pip._internal.vcs import is_url, vcs
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Dict, Optional, Set, Tuple, Union
|
||||||
Any, Dict, Optional, Set, Tuple, Union,
|
|
||||||
)
|
|
||||||
from pip._internal.req.req_file import ParsedRequirement
|
from pip._internal.req.req_file import ParsedRequirement
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,15 @@ from pip._internal.utils.urls import get_url_scheme, url_to_path
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, Callable, Dict, Iterator, List, NoReturn, Optional, Text, Tuple,
|
Any,
|
||||||
|
Callable,
|
||||||
|
Dict,
|
||||||
|
Iterator,
|
||||||
|
List,
|
||||||
|
NoReturn,
|
||||||
|
Optional,
|
||||||
|
Text,
|
||||||
|
Tuple,
|
||||||
)
|
)
|
||||||
|
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
|
@ -53,13 +53,13 @@ from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||||
from pip._internal.vcs import vcs
|
from pip._internal.vcs import vcs
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
|
||||||
Any, Dict, Iterable, List, Optional, Sequence, Union,
|
|
||||||
)
|
|
||||||
from pip._internal.build_env import BuildEnvironment
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
|
||||||
from pip._vendor.packaging.specifiers import SpecifierSet
|
|
||||||
from pip._vendor.packaging.markers import Marker
|
from pip._vendor.packaging.markers import Marker
|
||||||
|
from pip._vendor.packaging.specifiers import SpecifierSet
|
||||||
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
|
from pip._internal.build_env import BuildEnvironment
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -12,6 +12,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Dict, Iterable, List, Optional, Tuple
|
from typing import Dict, Iterable, List, Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,9 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import Dict, Iterator, Optional, Set, Type, Union
|
from typing import Dict, Iterator, Optional, Set, Type, Union
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
|
||||||
from pip._internal.models.link import Link
|
from pip._internal.models.link import Link
|
||||||
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,17 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple,
|
Any,
|
||||||
|
Callable,
|
||||||
|
Dict,
|
||||||
|
Iterable,
|
||||||
|
Iterator,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Set,
|
||||||
|
Tuple,
|
||||||
)
|
)
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -2,6 +2,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Callable, List
|
from typing import Callable, List
|
||||||
|
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
from pip._internal.req.req_set import RequirementSet
|
from pip._internal.req.req_set import RequirementSet
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import DefaultDict, List, Optional, Set, Tuple
|
from typing import DefaultDict, List, Optional, Set, Tuple
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
from pip._internal.cache import WheelCache
|
from pip._internal.cache import WheelCache
|
||||||
|
|
|
@ -38,8 +38,8 @@ from .requirements import (
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
FrozenSet,
|
|
||||||
Dict,
|
Dict,
|
||||||
|
FrozenSet,
|
||||||
Iterable,
|
Iterable,
|
||||||
List,
|
List,
|
||||||
Optional,
|
Optional,
|
||||||
|
|
|
@ -16,7 +16,7 @@ if MYPY_CHECK_RUNNING:
|
||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .base import Requirement, Candidate
|
from .base import Candidate, Requirement
|
||||||
from .factory import Factory
|
from .factory import Factory
|
||||||
|
|
||||||
# Notes on the relationship between the provider, the factory, and the
|
# Notes on the relationship between the provider, the factory, and the
|
||||||
|
|
|
@ -246,8 +246,8 @@ else:
|
||||||
def ioctl_GWINSZ(fd):
|
def ioctl_GWINSZ(fd):
|
||||||
try:
|
try:
|
||||||
import fcntl
|
import fcntl
|
||||||
import termios
|
|
||||||
import struct
|
import struct
|
||||||
|
import termios
|
||||||
cr = struct.unpack_from(
|
cr = struct.unpack_from(
|
||||||
'hh',
|
'hh',
|
||||||
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
|
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
|
||||||
|
|
|
@ -20,10 +20,10 @@ except ImportError:
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pip._internal.models.link import Link
|
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
|
from pip._internal.models.link import Link
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import sys
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Tuple, Text
|
from typing import List, Text, Tuple
|
||||||
|
|
||||||
BOMS = [
|
BOMS = [
|
||||||
(codecs.BOM_UTF8, 'utf-8'),
|
(codecs.BOM_UTF8, 'utf-8'),
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pip._internal.cli.main import main
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, List
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
def _wrapper(args=None):
|
def _wrapper(args=None):
|
||||||
|
|
|
@ -13,9 +13,8 @@ from pip._internal.utils.misc import read_chunks
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import BinaryIO, Dict, Iterator, List, NoReturn
|
||||||
Dict, List, BinaryIO, NoReturn, Iterator
|
|
||||||
)
|
|
||||||
from pip._vendor.six import PY3
|
from pip._vendor.six import PY3
|
||||||
if PY3:
|
if PY3:
|
||||||
from hashlib import _Hash
|
from hashlib import _Hash
|
||||||
|
|
|
@ -54,9 +54,20 @@ else:
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, AnyStr, Callable, Container, Iterable, Iterator, List, Optional,
|
Any,
|
||||||
Text, Tuple, TypeVar, Union,
|
AnyStr,
|
||||||
|
Callable,
|
||||||
|
Container,
|
||||||
|
Iterable,
|
||||||
|
Iterator,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Text,
|
||||||
|
Tuple,
|
||||||
|
TypeVar,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
VersionInfo = Tuple[int, int, int]
|
VersionInfo = Tuple[int, int, int]
|
||||||
|
|
|
@ -11,8 +11,9 @@ from pip._internal.utils.misc import display_path
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Tuple
|
|
||||||
from email.message import Message
|
from email.message import Message
|
||||||
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
from pip._vendor.pkg_resources import Distribution
|
from pip._vendor.pkg_resources import Distribution
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ from pip._vendor.six.moves import map
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Callable, Iterable, Iterator, Union, TypeVar
|
|
||||||
from multiprocessing import pool
|
from multiprocessing import pool
|
||||||
|
from typing import Callable, Iterable, Iterator, TypeVar, Union
|
||||||
|
|
||||||
Pool = Union[pool.Pool, pool.ThreadPool]
|
Pool = Union[pool.Pool, pool.ThreadPool]
|
||||||
S = TypeVar('S')
|
S = TypeVar('S')
|
||||||
|
|
|
@ -15,7 +15,14 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, Callable, Iterable, List, Mapping, Optional, Text, Union,
|
Any,
|
||||||
|
Callable,
|
||||||
|
Iterable,
|
||||||
|
List,
|
||||||
|
Mapping,
|
||||||
|
Optional,
|
||||||
|
Text,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
CommandArgs = List[Union[str, HiddenText]]
|
CommandArgs = List[Union[str, HiddenText]]
|
||||||
|
|
|
@ -16,6 +16,7 @@ from pip._internal.vcs.versioncontrol import VersionControl, vcs
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.utils.misc import HiddenText
|
from pip._internal.utils.misc import HiddenText
|
||||||
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ from pip._internal.vcs.versioncontrol import (
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.utils.misc import HiddenText
|
from pip._internal.utils.misc import HiddenText
|
||||||
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@ _svn_info_xml_url_re = re.compile(r'<url>(.*)</url>')
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
from pip._internal.utils.subprocess import CommandArgs
|
|
||||||
from pip._internal.utils.misc import HiddenText
|
from pip._internal.utils.misc import HiddenText
|
||||||
|
from pip._internal.utils.subprocess import CommandArgs
|
||||||
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
from pip._internal.vcs.versioncontrol import AuthInfo, RevOptions
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,19 @@ from pip._internal.utils.urls import get_url_scheme
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
Dict, Iterable, Iterator, List, Optional, Text, Tuple,
|
Any,
|
||||||
Type, Union, Mapping, Any
|
Dict,
|
||||||
|
Iterable,
|
||||||
|
Iterator,
|
||||||
|
List,
|
||||||
|
Mapping,
|
||||||
|
Optional,
|
||||||
|
Text,
|
||||||
|
Tuple,
|
||||||
|
Type,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
from pip._internal.utils.misc import HiddenText
|
from pip._internal.utils.misc import HiddenText
|
||||||
from pip._internal.utils.subprocess import CommandArgs
|
from pip._internal.utils.subprocess import CommandArgs
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,7 @@ from pip._internal.utils.urls import path_to_url
|
||||||
from pip._internal.vcs import vcs
|
from pip._internal.vcs import vcs
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Callable, Iterable, List, Optional, Tuple
|
||||||
Any, Callable, Iterable, List, Optional, Tuple,
|
|
||||||
)
|
|
||||||
|
|
||||||
from pip._internal.cache import WheelCache
|
from pip._internal.cache import WheelCache
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
|
|
|
@ -27,7 +27,8 @@ from tests.lib.venv import VirtualEnvironment
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Dict, Iterable
|
from typing import Dict, Iterable
|
||||||
|
|
||||||
from tests.lib.server import MockServer as _MockServer, Responder
|
from tests.lib.server import MockServer as _MockServer
|
||||||
|
from tests.lib.server import Responder
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
|
|
|
@ -422,9 +422,10 @@ def test_uninstallpathset_no_paths(caplog):
|
||||||
Test UninstallPathSet logs notification when there are no paths to
|
Test UninstallPathSet logs notification when there are no paths to
|
||||||
uninstall
|
uninstall
|
||||||
"""
|
"""
|
||||||
from pip._internal.req.req_uninstall import UninstallPathSet
|
|
||||||
from pkg_resources import get_distribution
|
from pkg_resources import get_distribution
|
||||||
|
|
||||||
|
from pip._internal.req.req_uninstall import UninstallPathSet
|
||||||
|
|
||||||
caplog.set_level(logging.INFO)
|
caplog.set_level(logging.INFO)
|
||||||
|
|
||||||
test_dist = get_distribution('pip')
|
test_dist = get_distribution('pip')
|
||||||
|
|
|
@ -31,6 +31,7 @@ from tests.lib.wheel import make_wheel
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from pip._internal.models.target_python import TargetPython
|
from pip._internal.models.target_python import TargetPython
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,16 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, Callable, Dict, Iterable, List, Optional, Text, Tuple, Type, Union
|
Any,
|
||||||
|
Callable,
|
||||||
|
Dict,
|
||||||
|
Iterable,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Text,
|
||||||
|
Tuple,
|
||||||
|
Type,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
from werkzeug.serving import BaseWSGIServer
|
from werkzeug.serving import BaseWSGIServer
|
||||||
|
|
|
@ -20,8 +20,16 @@ from tests.lib.path import Path
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import (
|
||||||
AnyStr, Callable, Dict, List, Iterable, Optional, Tuple, Sequence,
|
AnyStr,
|
||||||
TypeVar, Union,
|
Callable,
|
||||||
|
Dict,
|
||||||
|
Iterable,
|
||||||
|
List,
|
||||||
|
Optional,
|
||||||
|
Sequence,
|
||||||
|
Tuple,
|
||||||
|
TypeVar,
|
||||||
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
# path, digest, size
|
# path, digest, size
|
||||||
|
|
|
@ -100,6 +100,7 @@ class TestDistutilsScheme:
|
||||||
f.parent.mkdir()
|
f.parent.mkdir()
|
||||||
f.write_text("[install]\ninstall-scripts=" + install_scripts)
|
f.write_text("[install]\ninstall-scripts=" + install_scripts)
|
||||||
from distutils.dist import Distribution
|
from distutils.dist import Distribution
|
||||||
|
|
||||||
# patch the function that returns what config files are present
|
# patch the function that returns what config files are present
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
Distribution,
|
Distribution,
|
||||||
|
@ -121,6 +122,7 @@ class TestDistutilsScheme:
|
||||||
f.parent.mkdir()
|
f.parent.mkdir()
|
||||||
f.write_text("[install]\ninstall-lib=" + install_lib)
|
f.write_text("[install]\ninstall-lib=" + install_lib)
|
||||||
from distutils.dist import Distribution
|
from distutils.dist import Distribution
|
||||||
|
|
||||||
# patch the function that returns what config files are present
|
# patch the function that returns what config files are present
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
Distribution,
|
Distribution,
|
||||||
|
|
Loading…
Reference in New Issue