Skip to content

Commit fbec68b

Browse files
committed
Bump mypy
1 parent 1a8c7f0 commit fbec68b

File tree

8 files changed

+32
-27
lines changed

8 files changed

+32
-27
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: |

notebook2script/pointless.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
# 3rd party
148148
from astroid import Expr # type: ignore[import-untyped]
149149
from domdf_python_tools.paths import PathPlus
150-
from pylint import reporters # type: ignore[import-untyped]
151-
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
152-
from pylint.utils import utils # type: ignore[import-untyped]
150+
from pylint import reporters
151+
from pylint.lint.pylinter import PyLinter
152+
from pylint.utils import utils
153153

154154
# this package
155155
from notebook2script import pointless_checker
@@ -175,13 +175,13 @@ def load_default_plugins(self) -> None: # noqa: D102
175175
# Make sure to load the default reporter, because
176176
# the option has been set before the plugins had been loaded.
177177
if not self.reporter:
178-
self._load_reporter()
178+
self._load_reporter() # type: ignore[attr-defined]
179179

180180
def process_file(self, filename: str) -> None: # noqa: D102
181181
self.statements = []
182182

183183
with fix_import_path([filename]):
184-
self._check_files(self.get_ast, self._iterate_file_descrs([filename]))
184+
self._check_files(self.get_ast, self._iterate_file_descrs([filename])) # type: ignore[attr-defined]
185185

186186
path = PathPlus(filename)
187187
file_lines = path.read_lines()
@@ -235,7 +235,7 @@ def _patch_sys_path(args: Iterable[str]) -> List[str]:
235235
changes = []
236236
seen = set()
237237
for arg in args:
238-
path = utils.get_python_path(arg)
238+
path = utils.get_python_path(arg) # type: ignore[attr-defined]
239239
if path not in seen:
240240
changes.append(path)
241241
seen.add(path)

notebook2script/pointless_checker/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
#
2626

2727
# 3rd party
28-
from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker # type: ignore[import-untyped]
29-
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
30-
from pylint.utils import register_plugins # type: ignore[import-untyped]
28+
from pylint.checkers.base_checker import BaseChecker, BaseTokenChecker
29+
from pylint.lint.pylinter import PyLinter
30+
from pylint.utils import register_plugins
3131

3232

3333
def initialize(linter: PyLinter) -> None:

notebook2script/pointless_checker/base.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@
3232
import astroid.bases # type: ignore[import-untyped]
3333
import astroid.scoped_nodes # type: ignore[import-untyped]
3434
from astroid import Expr
35-
from pylint import interfaces # type: ignore[import-untyped]
36-
from pylint.checkers import utils # type: ignore[import-untyped]
37-
from pylint.checkers.base_checker import BaseChecker # type: ignore[import-untyped]
38-
from pylint.lint.pylinter import PyLinter # type: ignore[import-untyped]
35+
from pylint import interfaces
36+
from pylint.checkers import utils
37+
from pylint.checkers.base_checker import BaseChecker
38+
from pylint.lint.pylinter import PyLinter
3939

4040
__all__ = ["BasicChecker", "register"]
4141

4242

4343
class BasicChecker(BaseChecker): # noqa: D101
4444

45-
__implements__ = interfaces.IAstroidChecker
45+
__implements__ = interfaces.IAstroidChecker # type: ignore[attr-defined]
4646

47-
msgs: Dict[str, Tuple[str, str, str]] = {
47+
msgs = {
4848
"W0104": (
4949
"Statement seems to have no effect",
5050
"pointless-statement",
@@ -68,7 +68,11 @@ class BasicChecker(BaseChecker): # noqa: D101
6868

6969
reports = ()
7070

71-
@utils.check_messages("pointless-statement", "pointless-string-statement", "expression-not-assigned")
71+
@utils.check_messages( # type: ignore[attr-defined]
72+
"pointless-statement",
73+
"pointless-string-statement",
74+
"expression-not-assigned",
75+
)
7276
def visit_expr(self, node: Expr) -> None:
7377
"""
7478
Check for various kinds of statements without effect.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ autodoc_exclude_members = [
122122
]
123123

124124
[tool.mypy]
125-
python_version = "3.8"
125+
python_version = "3.9"
126126
namespace_packages = true
127127
check_untyped_defs = true
128128
warn_unused_ignores = true

repo_helper.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ conda_description: 'Convert Jupyter Notebooks to Python Scripts'
1212

1313
use_whey: true
1414
enable_conda: False
15-
mypy_version: "1.8.0"
15+
mypy_version: 1.16
16+
python_deploy_version: 3.9
1617

1718
conda_channels:
1819
- conda-forge

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ requires =
3434
[envlists]
3535
test = py37, py38, py39, py310
3636
qa = mypy, lint
37-
cov = py38, coverage
37+
cov = py39, coverage
3838

3939
[testenv]
4040
setenv =
@@ -78,7 +78,7 @@ commands =
7878
check-wheel-contents dist/
7979

8080
[testenv:lint]
81-
basepython = python3.8
81+
basepython = python3.9
8282
changedir = {toxinidir}
8383
ignore_errors = True
8484
skip_install = True
@@ -108,32 +108,32 @@ deps =
108108
commands = python3 -m flake8_rst_docstrings_sphinx notebook2script tests --allow-toolbox {posargs}
109109

110110
[testenv:perflint]
111-
basepython = python3.8
111+
basepython = python3.9
112112
changedir = {toxinidir}
113113
ignore_errors = True
114114
skip_install = True
115115
deps = perflint
116116
commands = python3 -m perflint notebook2script {posargs}
117117

118118
[testenv:mypy]
119-
basepython = python3.8
119+
basepython = python3.9
120120
ignore_errors = True
121121
changedir = {toxinidir}
122122
deps =
123-
mypy==1.8.0
123+
mypy==1.16
124124
-r{toxinidir}/tests/requirements.txt
125125
commands = mypy notebook2script tests {posargs}
126126

127127
[testenv:pyup]
128-
basepython = python3.8
128+
basepython = python3.9
129129
skip_install = True
130130
ignore_errors = True
131131
changedir = {toxinidir}
132132
deps = pyupgrade-directories
133133
commands = pyup_dirs notebook2script tests --py36-plus --recursive
134134

135135
[testenv:coverage]
136-
basepython = python3.8
136+
basepython = python3.9
137137
skip_install = True
138138
ignore_errors = True
139139
whitelist_externals = /bin/bash

0 commit comments

Comments
 (0)