Skip to content

Commit 2baeade

Browse files
committed
fix(sphinx-autodoc-sphinx): Correct option_spec type annotation for mypy
why: Base class Directive expects dict[str, Callable] | None, not dict[str, object]. what: - Change option_spec annotation from dict[str, object] to dict[str, t.Any] in AutoconfigvalueDirective and AutoconfigvaluesDirective
1 parent b2b2f8d commit 2baeade

File tree

1 file changed

+2
-2
lines changed
  • packages/sphinx-autodoc-sphinx/src/sphinx_autodoc_sphinx

1 file changed

+2
-2
lines changed

packages/sphinx-autodoc-sphinx/src/sphinx_autodoc_sphinx/_directives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class AutoconfigvalueDirective(SphinxDirective):
377377

378378
required_arguments = 1
379379
has_content = False
380-
option_spec: t.ClassVar[dict[str, object]] = {"no-index": directives.flag}
380+
option_spec: t.ClassVar[dict[str, t.Any]] = {"no-index": directives.flag}
381381

382382
def run(self) -> list[nodes.Node]:
383383
value = discover_config_value(self.arguments[0])
@@ -392,7 +392,7 @@ class AutoconfigvaluesDirective(SphinxDirective):
392392

393393
required_arguments = 1
394394
has_content = False
395-
option_spec: t.ClassVar[dict[str, object]] = {"no-index": directives.flag}
395+
option_spec: t.ClassVar[dict[str, t.Any]] = {"no-index": directives.flag}
396396

397397
def run(self) -> list[nodes.Node]:
398398
markup = render_config_values_markup(

0 commit comments

Comments
 (0)