diff --git a/pyproject.toml b/pyproject.toml index f0b25c135..afe358ade 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -251,7 +251,6 @@ module = [ "sphinx.domains.cpp", "sphinx.events", "sphinx.ext.autodoc", - "sphinx.ext.autodoc.directive", "sphinx.ext.autodoc.importer", "sphinx.ext.autosummary.generate", "sphinx.ext.doctest", diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 9b0bf66a0..57af4c5c6 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -31,14 +31,14 @@ AUTODOC_EXTENDABLE_OPTIONS = ['members', 'private-members', 'special-members', 'exclude-members'] -class DummyOptionSpec(dict): +class DummyOptionSpec(dict[str, Callable[[str], str]]): """An option_spec allows any options.""" def __bool__(self) -> bool: """Behaves like some options are defined.""" return True - def __getitem__(self, key: str) -> Callable[[str], str]: + def __getitem__(self, _key: str) -> Callable[[str], str]: return lambda x: x @@ -56,8 +56,9 @@ class DocumenterBridge: self.state = state -def process_documenter_options(documenter: type[Documenter], config: Config, options: dict, - ) -> Options: +def process_documenter_options( + documenter: type[Documenter], config: Config, options: dict[str, str], +) -> Options: """Recognize options of Documenter from user input.""" default_options = config.autodoc_default_options for name in AUTODOC_DEFAULT_OPTIONS: