From 4badbfa93e516ee357de8c3e48d0a82a984fd387 Mon Sep 17 00:00:00 2001 From: philippe Date: Tue, 24 Nov 2026 11:56:19 -0500 Subject: [PATCH] Annotate PAGE_REGISTRY for mypy 2 and bump mypy to 2.4.1 mypy 2 requires a type for the empty OrderedDict and fails the typing tests with var-annotated on dash/_pages.py. --- dash/_pages.py | 3 ++- requirements/ci.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dash/_pages.py b/dash/_pages.py index 22b7cecb4a..d6a3a06868 100644 --- a/dash/_pages.py +++ b/dash/_pages.py @@ -8,6 +8,7 @@ from fnmatch import fnmatch from os.path import isfile, join from pathlib import Path +from typing import Any from urllib.parse import parse_qs from . import _validate @@ -17,7 +18,7 @@ from ._utils import AttributeDict, get_root_path CONFIG = AttributeDict() -PAGE_REGISTRY = collections.OrderedDict() +PAGE_REGISTRY: collections.OrderedDict[str, dict[str, Any]] = collections.OrderedDict() def _infer_image(module): diff --git a/requirements/ci.txt b/requirements/ci.txt index 53adedaa8f..3e7b4fedb6 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -23,4 +23,4 @@ pytest-rerunfailures pytest-timeout jupyterlab<4.0.0 pyright==1.1.414 -mypy==1.15.0 +mypy==2.4.1