Shrink mypy whitelist for `sphinx.ext.autosummary.generate` (#12604)

This commit is contained in:
danieleades
2024-07-20 20:04:36 +01:00
committed by GitHub
parent 4808041cc9
commit 46fc784758
2 changed files with 2 additions and 3 deletions

View File

@@ -252,7 +252,6 @@ module = [
"sphinx.events",
"sphinx.ext.autodoc",
"sphinx.ext.autodoc.importer",
"sphinx.ext.autosummary.generate",
"sphinx.ext.doctest",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",

View File

@@ -145,7 +145,7 @@ class AutosummaryRenderer:
# ``install_gettext_translations`` is injected by the ``jinja2.ext.i18n`` extension
self.env.install_gettext_translations(app.translator) # type: ignore[attr-defined]
def render(self, template_name: str, context: dict) -> str:
def render(self, template_name: str, context: dict[str, Any]) -> str:
"""Render a template file."""
try:
template = self.env.get_template(template_name)
@@ -282,7 +282,7 @@ def generate_autosummary_content(
imported_members: bool,
app: Any,
recursive: bool,
context: dict,
context: dict[str, Any],
modname: str | None = None,
qualname: str | None = None,
) -> str: