Skip to content

Commit 91e18ad

Browse files
authored
Automated Mypy version sync (#69)
Update Mypy version to 1.20.0
2 parents a9b9ff1 + 51ac393 commit 91e18ad

30 files changed

Lines changed: 122 additions & 105 deletions

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
run-prek:
13-
uses: George-Ogden/actions/.github/workflows/lint.yaml@v4.0.2
13+
uses: George-Ogden/actions/.github/workflows/lint.yaml@v4.3.0

.github/workflows/release.yaml

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

1212
jobs:
1313
tag-and-release:
14-
uses: George-Ogden/actions/.github/workflows/python-release.yaml@v4.0.2
14+
uses: George-Ogden/actions/.github/workflows/python-release.yaml@v4.3.0
1515
with:
1616
validation-code: "import mypy.version; from mypy_pytest_plugin import plugin; plugin(mypy.version.__version__)"

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
shard: [0, 1, 2]
1616
total-shards: [3]
17-
uses: George-Ogden/actions/.github/workflows/python-test.yaml@v4.0.2
17+
uses: George-Ogden/actions/.github/workflows/python-test.yaml@v4.3.0
1818
with:
1919
python-versions: "['3.12', '3.13', '3.14']"
2020
timeout-minutes: 15

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ out.txt
66
stderr.txt
77
err.txt
88
notes.txt
9+
refactor.list
910
profile*.svg
1011
TODO
1112
*.pseudo
@@ -22,6 +23,9 @@ nohup*
2223
# Built Visual Studio Code Extensions
2324
*.vsix
2425

26+
### PyCharm ###
27+
.idea/
28+
2529
### Python ###
2630
# Byte-compiled / optimized / DLL files
2731
__pycache__/

.mirror.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DANGER: EDIT AT YOUR OWN RISK. Track this file in version control so that others can sync files correctly.
2-
- commit: fcb7c4aabba41339f8d81aa8b3a16dc3dd22a347
2+
- commit: 0fd8794e44ce1024bc27fbaab173c9cba1f6311a
33
files:
44
- .github/python-release.yaml
55
- .github/python-test.yaml

.pre-commit-config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
default_stages: [pre-commit]
2-
default_install_hook_types: [pre-commit, prepare-commit-msg, commit-msg]
2+
default_install_hook_types:
3+
[pre-commit, prepare-commit-msg, commit-msg, post-commit, pre-push]
34

45
ci:
56
skip:
@@ -8,7 +9,7 @@ ci:
89

910
repos:
1011
- repo: https://github.com/George-Ogden/mirror-rorrim/
11-
rev: v0.4.5
12+
rev: v0.4.9
1213
hooks:
1314
- id: mirror-check
1415
fail_fast: true
@@ -24,7 +25,7 @@ repos:
2425
- id: requirements-txt-fixer
2526

2627
- repo: https://github.com/George-Ogden/linter/
27-
rev: v2.1.0
28+
rev: v2.1.1
2829
hooks:
2930
- id: lint
3031
args: [--fix]
@@ -36,7 +37,7 @@ repos:
3637
args: [--severity=warning]
3738

3839
- repo: https://github.com/astral-sh/ruff-pre-commit/
39-
rev: v0.15.4
40+
rev: v0.15.9
4041
hooks:
4142
- id: ruff-check
4243
args: [--fix]
@@ -50,17 +51,17 @@ repos:
5051
- id: prettier
5152

5253
- repo: https://github.com/rhysd/actionlint/
53-
rev: v1.7.11
54+
rev: v1.7.12
5455
hooks:
5556
- id: actionlint
5657

5758
- repo: https://github.com/codespell-project/codespell/
58-
rev: v2.4.1
59+
rev: v2.4.2
5960
hooks:
6061
- id: codespell
6162

6263
- repo: https://github.com/George-Ogden/pre-commit-hooks/
63-
rev: v2.4.0
64+
rev: v3.1.0
6465
hooks:
6566
- id: check-merge-conflict
6667
- id: dbg-check

mypy.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ warn_unused_ignores = true
77
warn_unused_configs = true
88
strict_equality = true
99
exclude_gitignore = true
10-
plugins = plugin.py, mypy.plugins.proper_plugin
10+
warn_redundant_casts = true
11+
plugins = plugin.py, mypy.plugins.proper_plugin, utils.plugins.mypy_plugin
1112

1213
[xdist.*]
1314
ignore_missing_imports = true

mypy_pytest_plugin/checker_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class CheckerWrapper(abc.ABC):
1717
@abc.abstractmethod
1818
def __init__(self) -> None: ...
1919

20-
def fail(self, msg: str, *, context: Context, code: ErrorCode, file: str | None = None) -> None:
21-
self.checker.msg.fail(msg, context=context, code=code, file=file)
20+
def fail(self, msg: str, *, context: Context, code: ErrorCode) -> None:
21+
self.checker.fail(msg, context=context, code=code)
2222

2323
def note(self, msg: str, *, context: Context, code: ErrorCode | None) -> None:
2424
self.checker.note(msg, context=context, code=code)

mypy_pytest_plugin/fixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections.abc import Collection, Sequence
44
from dataclasses import dataclass
55
import enum
6-
from typing import ClassVar, Final, Self, cast
6+
from typing import ClassVar, Final, Self
77

88
from mypy.checker import TypeChecker
99
from mypy.nodes import GDEF, CallExpr, Context, Decorator, Expression, FuncDef, SymbolTableNode, Var
@@ -273,7 +273,7 @@ def _fixture_scope_from_call(self, call: CallExpr) -> FixtureScope:
273273

274274
def _fixture_scope_from_type(self, type_: Type, context: Context) -> FixtureScope:
275275
if isinstance(type_, LiteralType) and type_.value in FixtureScope._member_names_:
276-
return FixtureScope[cast(str, type_.value)]
276+
return FixtureScope[type_.value]
277277
self.fail("Invalid type for fixture scope.", context=context, code=INVALID_FIXTURE_SCOPE)
278278

279279
return FixtureScope.unknown

mypy_pytest_plugin/fixture_manager_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def test_fixture_manager_default_fixture_module_names() -> None:
8080
"_pytest.subtests",
8181
"_pytest.tmpdir",
8282
"inline_snapshot.pytest_plugin",
83+
"utils.plugins.pytest_plugin",
8384
"xdist.plugin",
8485
]
8586
)

0 commit comments

Comments
 (0)