Skip to content

Commit 9909dae

Browse files
authored
Upgrade mypy to 0.920 (#5535)
1 parent 7b79386 commit 9909dae

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ repos:
7777
types: [text] # necessary to include ChangeLog file
7878
files: ^(ChangeLog|doc/(.*/)*.*\.rst)
7979
- repo: https://github.com/pre-commit/mirrors-mypy
80-
rev: v0.910-1
80+
rev: v0.920
8181
hooks:
8282
- id: mypy
8383
name: mypy

pylint/extensions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def initialize(linter: "PyLinter") -> None:
1313
"""Initialize linter with checkers in the extensions directory"""
14-
register_plugins(linter, __path__[0]) # type: ignore[name-defined] # Fixed in https://github.com/python/mypy/pull/9454
14+
register_plugins(linter, __path__[0])
1515

1616

1717
__all__ = ["initialize"]

pylint/reporters/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
def initialize(linter: "PyLinter") -> None:
3939
"""initialize linter with reporters in this package"""
40-
utils.register_plugins(linter, __path__[0]) # type: ignore[name-defined] # Fixed in https://github.com/python/mypy/pull/9454
40+
utils.register_plugins(linter, __path__[0])
4141

4242

4343
__all__ = [

requirements_test_pre_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ black==21.12b0
44
flake8==4.0.1
55
flake8-typing-imports==1.11.0
66
isort==5.10.1
7-
mypy==0.910
7+
mypy==0.920

tests/config/unittest_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import re
1818
import sre_constants
19+
import sys
1920
from typing import Dict, Tuple, Type
2021

2122
import pytest
@@ -25,7 +26,10 @@
2526
from pylint.testutils import CheckerTestCase, set_config
2627
from pylint.utils.utils import get_global_option
2728

28-
RE_PATTERN_TYPE = getattr(re, "Pattern", getattr(re, "_pattern_type", None))
29+
if sys.version_info >= (3, 7):
30+
RE_PATTERN_TYPE = re.Pattern
31+
else:
32+
RE_PATTERN_TYPE = re._pattern_type # pylint: disable=no-member
2933

3034

3135
def test__regexp_validator_valid() -> None:

0 commit comments

Comments
 (0)