Skip to content

Commit f58b908

Browse files
committed
docs(_ext[sab_demo]): Fix mypy dict type-arg on setup()
why: CI runs mypy . (whole workspace) but local ran mypy src tests; dict return annotation needs generic args to pass strict type-arg check. what: - Add import typing as t - Annotate setup() return type as dict[str, t.Any]
1 parent 26342b7 commit f58b908

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/_ext/sab_demo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
from __future__ import annotations
99

10+
import typing as t
11+
1012
from docutils import nodes
1113
from sphinx.application import Sphinx
1214
from sphinx.util.docutils import SphinxDirective
@@ -140,7 +142,7 @@ def _row(*badge_nodes: nodes.Node, label: str = "") -> nodes.paragraph:
140142
return result
141143

142144

143-
def setup(app: Sphinx) -> dict:
145+
def setup(app: Sphinx) -> dict[str, t.Any]:
144146
"""Register the ``sab-badge-demo`` directive."""
145147
app.add_directive("sab-badge-demo", BadgeDemoDirective)
146148
app.add_css_file("css/sab_demo.css")

0 commit comments

Comments
 (0)