Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: 'src/pip/_vendor/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v4.0.1
hooks:
- id: check-builtin-literals
- id: check-added-large-files
Expand All @@ -16,23 +16,23 @@ repos:
- id: trailing-whitespace
exclude: .patch

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [
'flake8-bugbear==20.1.4'
]
exclude: tests/data

- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
files: \.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.770
rev: v0.910
hooks:
- id: mypy
exclude: docs|tests
Expand All @@ -43,7 +43,7 @@ repos:
args: ["--pretty", "-2"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
rev: v1.9.0
hooks:
- id: python-no-log-warn
- id: python-no-eval
Expand All @@ -55,6 +55,6 @@ repos:
exclude: NEWS.rst

- repo: https://github.com/mgedmin/check-manifest
rev: '0.42'
rev: '0.46'
hooks:
- id: check-manifest
2 changes: 1 addition & 1 deletion src/pip/_internal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Optional, List
from typing import List, Optional


def main(args=None):
Expand Down
3 changes: 2 additions & 1 deletion src/pip/_internal/build_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

if MYPY_CHECK_RUNNING:
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

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from pip._internal.utils.urls import path_to_url

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

Expand Down
5 changes: 2 additions & 3 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@
from pip._internal.utils.virtualenv import running_under_virtualenv

if MYPY_CHECK_RUNNING:
from typing import List, Optional, Tuple, Any
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
)

__all__ = ['Command']

Expand Down
3 changes: 2 additions & 1 deletion src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Any, Callable, Dict, Optional, Tuple
from optparse import OptionParser, Values
from typing import Any, Callable, Dict, Optional, Tuple

from pip._internal.cli.parser import ConfigOptionParser

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/command_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Iterator, ContextManager, TypeVar
from typing import ContextManager, Iterator, TypeVar

_T = TypeVar('_T', covariant=True)

Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/main_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Tuple, List
from typing import List, Tuple


__all__ = ["create_main_parser", "parse_command"]
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/spinners.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Iterator, IO
from typing import IO, Iterator

logger = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

if MYPY_CHECK_RUNNING:
from typing import Any

from pip._internal.cli.base_command import Command


Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
logger = logging.getLogger(__name__)

if MYPY_CHECK_RUNNING:
from typing import List, Any
from optparse import Values
from typing import Any, List


class CheckCommand(Command):
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/commands/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import List
from optparse import Values
from typing import List

BASE_COMPLETION = """
# pip {shell} completion start{script}# pip {shell} completion end
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/commands/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import List
from optparse import Values
from typing import List

logger = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions src/pip/_internal/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from types import ModuleType
from typing import List, Optional, Dict
from optparse import Values
from types import ModuleType
from typing import Dict, List, Optional

from pip._internal.configuration import Configuration

logger = logging.getLogger(__name__)
Expand Down
6 changes: 4 additions & 2 deletions src/pip/_internal/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import List
from optparse import Values
from typing import List


class HelpCommand(Command):
Expand All @@ -20,7 +20,9 @@ class HelpCommand(Command):
def run(self, options, args):
# type: (Values, List[str]) -> int
from pip._internal.commands import (
commands_dict, create_command, get_similar_commands,
commands_dict,
create_command,
get_similar_commands,
)

try:
Expand Down
5 changes: 3 additions & 2 deletions src/pip/_internal/commands/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

if MYPY_CHECK_RUNNING:
from optparse import Values
from typing import List, Set, Tuple, Iterator
from typing import Iterator, List, Set, Tuple

from pip._internal.network.session import PipSession
from pip._vendor.pkg_resources import Distribution

from pip._internal.network.session import PipSession

logger = logging.getLogger(__name__)


Expand Down
3 changes: 2 additions & 1 deletion src/pip/_internal/commands/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

if MYPY_CHECK_RUNNING:
from optparse import Values
from typing import List, Dict, Optional
from typing import Dict, List, Optional

from typing_extensions import TypedDict
TransformedHit = TypedDict(
'TransformedHit',
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if MYPY_CHECK_RUNNING:
from optparse import Values
from typing import List, Dict, Iterator
from typing import Dict, Iterator, List

logger = logging.getLogger(__name__)

Expand Down
4 changes: 1 addition & 3 deletions src/pip/_internal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import (
Any, Dict, Iterable, List, NewType, Optional, Tuple
)
from typing import Any, Dict, Iterable, List, NewType, Optional, Tuple

RawConfigParser = configparser.RawConfigParser # Shorthand
Kind = NewType("Kind", str)
Expand Down
3 changes: 2 additions & 1 deletion src/pip/_internal/distributions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
from typing import Optional

from pip._vendor.pkg_resources import Distribution
from pip._internal.req import InstallRequirement

from pip._internal.index.package_finder import PackageFinder
from pip._internal.req import InstallRequirement


@add_metaclass(abc.ABCMeta)
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/distributions/installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Optional

from pip._vendor.pkg_resources import Distribution

from pip._internal.index.package_finder import PackageFinder


Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/distributions/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Set, Tuple

from pip._vendor.pkg_resources import Distribution

from pip._internal.index.package_finder import PackageFinder


Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/distributions/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

if MYPY_CHECK_RUNNING:
from pip._vendor.pkg_resources import Distribution

from pip._internal.index.package_finder import PackageFinder


Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Any, Optional, List, Dict
from typing import Any, Dict, List, Optional

from pip._vendor.pkg_resources import Distribution
from pip._vendor.six import PY3
Expand Down
14 changes: 11 additions & 3 deletions src/pip/_internal/index/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@
from pip._internal.vcs import is_url, vcs

if MYPY_CHECK_RUNNING:
import xml.etree.ElementTree
from typing import (
Callable, Iterable, List, MutableMapping, Optional,
Protocol, Sequence, Tuple, TypeVar, Union,
Callable,
Iterable,
List,
MutableMapping,
Optional,
Protocol,
Sequence,
Tuple,
TypeVar,
Union,
)
import xml.etree.ElementTree

from pip._vendor.requests import Response

Expand Down
9 changes: 8 additions & 1 deletion src/pip/_internal/index/package_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@

if MYPY_CHECK_RUNNING:
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
Expand Down
3 changes: 1 addition & 2 deletions src/pip/_internal/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
from pip._internal.utils.virtualenv import running_under_virtualenv

if MYPY_CHECK_RUNNING:
from typing import Dict, List, Optional, Union

from distutils.cmd import Command as DistutilsCommand
from typing import Dict, List, Optional, Union


# Application Directories
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Optional, List
from typing import List, Optional


def main(args=None):
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/models/candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

if MYPY_CHECK_RUNNING:
from pip._vendor.packaging.version import _BaseVersion

from pip._internal.models.link import Link


Expand Down
4 changes: 1 addition & 3 deletions src/pip/_internal/models/direct_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import (
Any, Dict, Iterable, Optional, Type, TypeVar, Union
)
from typing import Any, Dict, Iterable, Optional, Type, TypeVar, Union

T = TypeVar("T")

Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/models/format_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
from typing import Optional, Set, FrozenSet
from typing import FrozenSet, Optional, Set


class FormatControl(object):
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

if MYPY_CHECK_RUNNING:
from typing import Optional, Text, Tuple, Union

from pip._internal.index.collector import HTMLPage
from pip._internal.utils.hashes import Hashes

Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/models/selection_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

if MYPY_CHECK_RUNNING:
from typing import Optional

from pip._internal.models.format_control import FormatControl


Expand Down
Loading