From 007145d1cbc76f83bd0f5bc9211bf0bf29014520 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 21:58:08 +0000 Subject: [PATCH 1/3] chore: update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v2.1.0 → v2.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v2.1.0...v2.3.0) - [github.com/astral-sh/ruff-pre-commit: v0.15.20 → v0.15.21](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.20...v0.15.21) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e39ba275e..fcc8b96b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: types_or: [yaml, html, json] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v2.1.0" + rev: "v2.3.0" hooks: - id: mypy files: ipykernel @@ -95,7 +95,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.15.21 hooks: - id: ruff-check types_or: [python, jupyter] From 710ade4649e989ca38f1c353076c0f3feec4c06d Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 17 Jul 2026 13:05:16 +0100 Subject: [PATCH 2/3] Fix --- ipykernel/ipkernel.py | 2 +- ipykernel/kernelapp.py | 4 ++-- ipykernel/kernelbase.py | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ipykernel/ipkernel.py b/ipykernel/ipkernel.py index 7ce9cc013..dbb9c020e 100644 --- a/ipykernel/ipkernel.py +++ b/ipykernel/ipkernel.py @@ -298,7 +298,7 @@ def _forward_input(self, allow_stdin=False): builtins.input = self.raw_input self._save_getpass = getpass.getpass - getpass.getpass = self.getpass + getpass.getpass = self.getpass # type:ignore[assignment] def _restore_input(self): """Restore raw_input, getpass""" diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index 9413b86d6..ee93dbbb3 100644 --- a/ipykernel/kernelapp.py +++ b/ipykernel/kernelapp.py @@ -588,7 +588,7 @@ def patch_io(self): def enable(file=sys.__stderr__, all_threads=True, **kwargs): return faulthandler_enable(file=file, all_threads=all_threads, **kwargs) - faulthandler.enable = enable + faulthandler.enable = enable # type:ignore[assignment] if hasattr(faulthandler, "register"): faulthandler_register = faulthandler.register @@ -743,7 +743,7 @@ def init_pdb(self): # Only available in newer IPython releases: debugger.Pdb = debugger.InterruptiblePdb # type:ignore[misc] pdb.Pdb = debugger.Pdb # type:ignore[assignment,misc] - pdb.set_trace = debugger.set_trace + pdb.set_trace = debugger.set_trace # type:ignore[assignment] @catch_config_error def initialize(self, argv=None): diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py index 3e9ce0f7c..62e4fa239 100644 --- a/ipykernel/kernelbase.py +++ b/ipykernel/kernelbase.py @@ -845,7 +845,7 @@ async def execute_request(self, stream, ident, parent): if inspect.isawaitable(reply_content): reply_content = await reply_content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_execute", target=self.do_execute), PendingDeprecationWarning, stacklevel=1, @@ -907,7 +907,7 @@ async def complete_request(self, stream, ident, parent): if inspect.isawaitable(matches): matches = await matches else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_complete", target=self.do_complete), PendingDeprecationWarning, stacklevel=1, @@ -941,7 +941,7 @@ async def inspect_request(self, stream, ident, parent): if inspect.isawaitable(reply_content): reply_content = await reply_content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_inspect", target=self.do_inspect), PendingDeprecationWarning, stacklevel=1, @@ -966,7 +966,7 @@ async def history_request(self, stream, ident, parent): if inspect.isawaitable(reply_content): reply_content = await reply_content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_history", target=self.do_history), PendingDeprecationWarning, stacklevel=1, @@ -1094,7 +1094,7 @@ async def shutdown_request(self, stream, ident, parent): if inspect.isawaitable(content): content = await content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_shutdown", target=self.do_shutdown), PendingDeprecationWarning, stacklevel=1, @@ -1133,7 +1133,7 @@ async def is_complete_request(self, stream, ident, parent): if inspect.isawaitable(reply_content): reply_content = await reply_content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format(func_name="do_is_complete", target=self.do_is_complete), PendingDeprecationWarning, stacklevel=1, @@ -1155,7 +1155,7 @@ async def debug_request(self, stream, ident, parent): if inspect.isawaitable(reply_content): reply_content = await reply_content else: - warnings.warn( + warnings.warn( # type:ignore[unreachable] _AWAITABLE_MESSAGE.format( func_name="do_debug_request", target=self.do_debug_request ), From 1e8f87fa24ce61ea2fd2e39baba014ee4b058dea Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 17 Jul 2026 13:25:54 +0100 Subject: [PATCH 3/3] Fix --- ipykernel/ipkernel.py | 2 +- ipykernel/kernelapp.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ipykernel/ipkernel.py b/ipykernel/ipkernel.py index dbb9c020e..7ce9cc013 100644 --- a/ipykernel/ipkernel.py +++ b/ipykernel/ipkernel.py @@ -298,7 +298,7 @@ def _forward_input(self, allow_stdin=False): builtins.input = self.raw_input self._save_getpass = getpass.getpass - getpass.getpass = self.getpass # type:ignore[assignment] + getpass.getpass = self.getpass def _restore_input(self): """Restore raw_input, getpass""" diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index ee93dbbb3..9413b86d6 100644 --- a/ipykernel/kernelapp.py +++ b/ipykernel/kernelapp.py @@ -588,7 +588,7 @@ def patch_io(self): def enable(file=sys.__stderr__, all_threads=True, **kwargs): return faulthandler_enable(file=file, all_threads=all_threads, **kwargs) - faulthandler.enable = enable # type:ignore[assignment] + faulthandler.enable = enable if hasattr(faulthandler, "register"): faulthandler_register = faulthandler.register @@ -743,7 +743,7 @@ def init_pdb(self): # Only available in newer IPython releases: debugger.Pdb = debugger.InterruptiblePdb # type:ignore[misc] pdb.Pdb = debugger.Pdb # type:ignore[assignment,misc] - pdb.set_trace = debugger.set_trace # type:ignore[assignment] + pdb.set_trace = debugger.set_trace @catch_config_error def initialize(self, argv=None):