Skip to content

Commit 3941ef5

Browse files
committed
Bump mypy
1 parent a872145 commit 3941ef5

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
if: steps.changes.outputs.code == 'true'
3636
uses: "actions/setup-python@v5"
3737
with:
38-
python-version: "3.8"
38+
python-version: "3.9"
3939

4040
- name: Install dependencies 🔧
4141
if: steps.changes.outputs.code == 'true'

.github/workflows/mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
if: steps.changes.outputs.code == 'true'
4141
uses: "actions/setup-python@v5"
4242
with:
43-
python-version: "3.8"
43+
python-version: "3.9"
4444

4545
- name: Install dependencies 🔧
4646
run: |

flake8_github_actions/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@
2727
#
2828

2929
# stdlib
30-
from typing import Any
30+
from typing import TYPE_CHECKING, Any
3131

3232
# 3rd party
33-
from flake8.formatting.base import BaseFormatter # type: ignore
33+
from flake8.formatting.base import BaseFormatter
34+
35+
if TYPE_CHECKING:
36+
# 3rd party
37+
from flake8.violation import Violation
3438

3539
__author__: str = "Dominic Davis-Foster"
3640
__copyright__: str = "2020-2021 Dominic Davis-Foster"
@@ -72,7 +76,7 @@ def finished(self, filename: Any) -> None:
7276

7377
self.files_reported_count += 1
7478

75-
def format(self, violation) -> None: # noqa: A003 # pylint: disable=redefined-builtin
79+
def format(self, violation: "Violation") -> None: # noqa: A003 # pylint: disable=redefined-builtin
7680
"""
7781
Format a violation.
7882
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ license-key = "MIT"
4141
package = "flake8_github_actions"
4242

4343
[tool.mypy]
44-
python_version = "3.8"
44+
python_version = "3.9"
4545
namespace_packages = true
4646
check_untyped_defs = true
4747
warn_unused_ignores = true

repo_helper.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ enable_docs: false
1616
requires_python: 3.6
1717
pre_commit_exclude: "^tests/bad_code.py$"
1818
use_whey: true
19+
mypy_version: 1.16
20+
python_deploy_version: 3.9
1921

2022
python_versions:
2123
3.7:

stubs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
types-flake8

tests/test_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from coincidence.regressions import FileRegressionFixture, check_file_regression
44
from domdf_python_tools.compat import importlib_metadata
55
from domdf_python_tools.paths import PathPlus
6-
from flake8.main import cli # type: ignore
6+
from flake8.main import cli
77

88
bad_code = PathPlus(__file__).parent / "bad_code.py"
99

tox.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test =
5555
pypy38-flake8{4,5,6,7}
5656
pypy39-flake8{4,5,6,7}
5757
qa = mypy, lint
58-
cov = py38-flake84, coverage
58+
cov = py39-flake84, coverage
5959

6060
[testenv]
6161
setenv =
@@ -109,32 +109,33 @@ commands =
109109
check-wheel-contents dist/
110110

111111
[testenv:perflint]
112-
basepython = python3.8
112+
basepython = python3.9
113113
changedir = {toxinidir}
114114
ignore_errors = True
115115
skip_install = True
116116
deps = perflint
117117
commands = python3 -m perflint flake8_github_actions {posargs}
118118

119119
[testenv:mypy]
120-
basepython = python3.8
120+
basepython = python3.9
121121
ignore_errors = True
122122
changedir = {toxinidir}
123123
deps =
124-
mypy==0.971
124+
mypy==1.16
125125
-r{toxinidir}/tests/requirements.txt
126+
-r{toxinidir}/stubs.txt
126127
commands = mypy flake8_github_actions tests {posargs}
127128

128129
[testenv:pyup]
129-
basepython = python3.8
130+
basepython = python3.9
130131
skip_install = True
131132
ignore_errors = True
132133
changedir = {toxinidir}
133134
deps = pyupgrade-directories
134135
commands = pyup_dirs flake8_github_actions tests --py36-plus --recursive
135136

136137
[testenv:coverage]
137-
basepython = python3.8
138+
basepython = python3.9
138139
skip_install = True
139140
ignore_errors = True
140141
whitelist_externals = /bin/bash

0 commit comments

Comments
 (0)