Skip to content

Commit dd1e094

Browse files
authored
update pre-commit and related (#1465)
1 parent 95f2451 commit dd1e094

File tree

14 files changed

+45
-46
lines changed

14 files changed

+45
-46
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v5.0.0
7+
rev: v6.0.0
88
hooks:
99
- id: check-case-conflict
1010
- id: check-ast
@@ -22,16 +22,15 @@ repos:
2222
- id: trailing-whitespace
2323

2424
- repo: https://github.com/python-jsonschema/check-jsonschema
25-
rev: 0.33.2
25+
rev: 0.34.1
2626
hooks:
2727
- id: check-github-workflows
2828

29-
- repo: https://github.com/executablebooks/mdformat
30-
rev: 0.7.22
29+
- repo: https://github.com/hukkin/mdformat
30+
rev: 1.0.0
3131
hooks:
3232
- id: mdformat
33-
additional_dependencies:
34-
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
33+
additional_dependencies: [mdformat-footnote]
3534

3635
- repo: https://github.com/pre-commit/mirrors-prettier
3736
rev: "v4.0.0-alpha.8"
@@ -40,7 +39,7 @@ repos:
4039
types_or: [yaml, html, json]
4140

4241
- repo: https://github.com/pre-commit/mirrors-mypy
43-
rev: "v1.17.0"
42+
rev: "v1.18.2"
4443
hooks:
4544
- id: mypy
4645
files: ipykernel
@@ -55,7 +54,7 @@ repos:
5554
]
5655

5756
- repo: https://github.com/adamchainz/blacken-docs
58-
rev: "1.19.1"
57+
rev: "1.20.0"
5958
hooks:
6059
- id: blacken-docs
6160
additional_dependencies: [black==23.7.0]
@@ -74,16 +73,16 @@ repos:
7473
- id: rst-inline-touching-normal
7574

7675
- repo: https://github.com/astral-sh/ruff-pre-commit
77-
rev: v0.12.4
76+
rev: v0.14.2
7877
hooks:
79-
- id: ruff
78+
- id: ruff-check
8079
types_or: [python, jupyter]
8180
args: ["--fix", "--show-fixes"]
8281
- id: ruff-format
8382
types_or: [python, jupyter]
8483

8584
- repo: https://github.com/scientific-python/cookie
86-
rev: "2025.05.02"
85+
rev: "2025.10.20"
8786
hooks:
8887
- id: sp-repo-review
8988
additional_dependencies: ["repo-review[cli]"]

ipykernel/debugger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def start(self):
429429
(self.shell_socket.getsockopt(ROUTING_ID)),
430430
)
431431

432-
ident, msg = self.session.recv(self.shell_socket, mode=0)
432+
_ident, msg = self.session.recv(self.shell_socket, mode=0)
433433
self.debugpy_initialized = msg["content"]["status"] == "ok"
434434

435435
# Don't remove leading empty lines when debugging so the breakpoints are correctly positioned

ipykernel/inprocess/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _dispatch_to_kernel(self, msg):
206206
else:
207207
loop = asyncio.get_event_loop() # type:ignore[unreachable]
208208
loop.run_until_complete(kernel.dispatch_shell(msg_parts))
209-
idents, reply_msg = self.session.recv(stream, copy=False)
209+
_idents, reply_msg = self.session.recv(stream, copy=False)
210210
self.shell_channel.call_handlers_later(reply_msg)
211211

212212
def get_shell_msg(self, block=True, timeout=None):

ipykernel/inprocess/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _io_dispatch(self, change):
135135
"""Called when a message is sent to the IO socket."""
136136
assert self.iopub_socket.io_thread is not None
137137
assert self.session is not None
138-
ident, msg = self.session.recv(self.iopub_socket.io_thread.socket, copy=False)
138+
_ident, msg = self.session.recv(self.iopub_socket.io_thread.socket, copy=False)
139139
for frontend in self.frontends:
140140
assert frontend is not None
141141
frontend.iopub_channel.call_handlers(msg)

ipykernel/pylab/backend_inline.py

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

66
import warnings
77

8-
from matplotlib_inline.backend_inline import * # type:ignore[import-untyped] # noqa: F403 # analysis: ignore
8+
from matplotlib_inline.backend_inline import * # noqa: F403 # analysis: ignore
99

1010
warnings.warn(
1111
"`ipykernel.pylab.backend_inline` is deprecated, directly "

ipykernel/pylab/config.py

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

66
import warnings
77

8-
from matplotlib_inline.config import * # type:ignore[import-untyped] # noqa: F403 # analysis: ignore
8+
from matplotlib_inline.config import * # noqa: F403 # analysis: ignore
99

1010
warnings.warn(
1111
"`ipykernel.pylab.config` is deprecated, directly use `matplotlib_inline.config`",

ipykernel/zmqshell.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def edit(self, parameter_s="", last_call=None):
352352

353353
payload = {"source": "edit_magic", "filename": filename, "line_number": lineno}
354354
assert self.shell is not None
355-
self.shell.payload_manager.write_payload(payload)
355+
self.shell.payload_manager.write_payload(payload) # type: ignore[unreachable]
356356

357357
# A few magics that are adapted to the specifics of using pexpect and a
358358
# remote terminal
@@ -361,7 +361,7 @@ def edit(self, parameter_s="", last_call=None):
361361
def clear(self, arg_s):
362362
"""Clear the terminal."""
363363
assert self.shell is not None
364-
if os.name == "posix":
364+
if os.name == "posix": # type: ignore[unreachable]
365365
self.shell.system("clear")
366366
else:
367367
self.shell.system("cls")
@@ -383,7 +383,7 @@ def less(self, arg_s):
383383

384384
if arg_s.endswith(".py"):
385385
assert self.shell is not None
386-
cont = self.shell.pycolorize(openpy.read_py_file(arg_s, skip_encoding_cookie=False))
386+
cont = self.shell.pycolorize(openpy.read_py_file(arg_s, skip_encoding_cookie=False)) # type: ignore[unreachable]
387387
else:
388388
with open(arg_s) as fid:
389389
cont = fid.read()
@@ -398,7 +398,7 @@ def less(self, arg_s):
398398
def man(self, arg_s):
399399
"""Find the man page for the given command and display in pager."""
400400
assert self.shell is not None
401-
page.page(self.shell.getoutput("man %s | col -b" % arg_s, split=False))
401+
page.page(self.shell.getoutput("man %s | col -b" % arg_s, split=False)) # type: ignore[unreachable]
402402

403403
@line_magic
404404
def connect_info(self, arg_s):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ dependencies = ["pre-commit"]
120120
detached = true
121121
[tool.hatch.envs.lint.scripts]
122122
build = [
123-
"pre-commit run --all-files ruff",
123+
"pre-commit run --all-files ruff-check",
124124
"pre-commit run --all-files ruff-format"
125125
]
126126

tests/inprocess/test_kernel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_pylab(kc):
5757
"""Does %pylab work in the in-process kernel?"""
5858
_ = pytest.importorskip("matplotlib", reason="This test requires matplotlib")
5959
kc.execute("%pylab")
60-
out, err = assemble_output(kc.get_iopub_msg)
60+
out, _err = assemble_output(kc.get_iopub_msg)
6161
assert "matplotlib" in out
6262

6363

@@ -85,7 +85,7 @@ def test_stdout(kc):
8585
kc = BlockingInProcessKernelClient(kernel=kernel, session=kernel.session)
8686
kernel.frontends.append(kc)
8787
kc.execute('print("bar")')
88-
out, err = assemble_output(kc.get_iopub_msg)
88+
out, _err = assemble_output(kc.get_iopub_msg)
8989
assert out == "bar\n"
9090

9191

@@ -102,7 +102,7 @@ def test_capfd(kc):
102102
kernel.frontends.append(kc)
103103
kc.execute("import os")
104104
kc.execute('os.system("echo capfd")')
105-
out, err = assemble_output(kc.iopub_channel)
105+
out, _err = assemble_output(kc.iopub_channel)
106106
assert out == "capfd\n"
107107

108108

tests/test_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _setup_env():
2323

2424
def test_async_await():
2525
flush_channels(KC)
26-
msg_id, content = execute("import asyncio; await asyncio.sleep(0.1)", KC)
26+
_msg_id, content = execute("import asyncio; await asyncio.sleep(0.1)", KC)
2727
assert content["status"] == "ok", content
2828

2929

0 commit comments

Comments
 (0)