From 02ba01159bc9cf380d9c3930dcb1ac5df8274639 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:52:26 +0000 Subject: [PATCH 1/2] ci: [pre-commit.ci] autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/abravalheri/validate-pyproject: 0.26 → v0.27](https://github.com/abravalheri/validate-pyproject/compare/0.26...v0.27) - [github.com/adhtruong/mirrors-typos: v1.50.2 → v1.51.1](https://github.com/adhtruong/mirrors-typos/compare/v1.50.2...v1.51.1) - [github.com/astral-sh/ruff-pre-commit: v0.16.8 → v0.17.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.16.8...v0.17.3) - [github.com/pre-commit/mirrors-mypy: v2.3.1 → v2.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v2.3.1...v2.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edfce94..adcb22b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: repos: - repo: https://github.com/abravalheri/validate-pyproject - rev: "0.26" + rev: "v0.27" hooks: - id: validate-pyproject @@ -16,20 +16,20 @@ repos: files: "^\\.github/workflows/.*\\.ya?ml$" - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.50.2 + rev: v1.51.1 hooks: - id: typos args: [--force-exclude] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.8 + rev: v0.17.3 hooks: - id: ruff-check args: ["--fix", "--unsafe-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.3.1 + rev: v2.4.1 hooks: - id: mypy files: "^src/" From 864230d028c1c964aa8bc584c66e34cf8b52284c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 20 Nov 2026 10:25:20 -0500 Subject: [PATCH 2/2] fix: work around mypy 2.4 `reversed()` inference regression mypy 2.4 infers `Any` for items of `reversed(list[NamedTuple])` when the tuple has an `Any`-containing field (python/mypy#22174), which trips `no-any-return` in `get_context_prioritized_keybinding`. Annotate the loop variable explicitly. Co-Authored-By: Claude Opus 5.5 --- src/app_model/registries/_keybindings_reg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app_model/registries/_keybindings_reg.py b/src/app_model/registries/_keybindings_reg.py index e4c6d8a..75c6586 100644 --- a/src/app_model/registries/_keybindings_reg.py +++ b/src/app_model/registries/_keybindings_reg.py @@ -221,6 +221,8 @@ def get_context_prioritized_keybinding( """ if key in self._keymap: + # mypy 2.4 infers `Any` here: https://github.com/python/mypy/issues/22174 + entry: _RegisteredKeyBinding for entry in reversed(self._keymap[key]): if entry.when is None or entry.when.eval(context): return entry