diff --git a/pyproject.toml b/pyproject.toml index 10aff50404d..3eace448421 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -237,7 +237,6 @@ module = [ "sphinx.ext.doctest", "sphinx.ext.graphviz", "sphinx.ext.inheritance_diagram", - "sphinx.ext.napoleon.docstring", "sphinx.highlighting", "sphinx.jinja2glue", "sphinx.registry", diff --git a/sphinx/application.py b/sphinx/application.py index ea1f79ba74e..3547b279d65 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -218,7 +218,7 @@ def __init__(self, srcdir: str | os.PathLike[str], confdir: str | os.PathLike[st # keep last few messages for traceback # This will be filled by sphinx.util.logging.LastMessagesWriter - self.messagelog: deque = deque(maxlen=10) + self.messagelog: deque[str] = deque(maxlen=10) # say hello to the world logger.info(bold(__('Running Sphinx v%s')), sphinx.__display_version__) @@ -1718,7 +1718,7 @@ def newest_template_mtime(self) -> float: """ return 0 - def render(self, template: str, context: dict) -> None: + def render(self, template: str, context: dict[str, Any]) -> None: """Called by the builder to render a template given as a filename with a specified context (a Python dictionary). """ diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index cc3c7f4ce1a..bdd0cc713f0 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -52,7 +52,7 @@ _SINGLETONS = ("None", "True", "False", "Ellipsis") -class Deque(collections.deque): +class Deque(collections.deque[Any]): """ A subclass of deque that mimics ``pockets.iterators.modify_iter``. @@ -195,7 +195,7 @@ def __init__( if not hasattr(self, '_directive_sections'): self._directive_sections: list[str] = [] if not hasattr(self, '_sections'): - self._sections: dict[str, Callable] = { + self._sections: dict[str, Callable[..., list[str]]] = { 'args': self._parse_parameters_section, 'arguments': self._parse_parameters_section, 'attention': partial(self._parse_admonition, 'attention'), @@ -1023,7 +1023,7 @@ def is_numeric(token: str) -> bool: def _convert_numpy_type_spec( - _type: str, location: str | None = None, translations: dict | None = None, + _type: str, location: str | None = None, translations: dict[str, str] | None = None, ) -> str: if translations is None: translations = {}