diff --git a/docs/_scripts/macros.py b/docs/_scripts/macros.py index fbf09f7d..b4fea6e2 100644 --- a/docs/_scripts/macros.py +++ b/docs/_scripts/macros.py @@ -6,7 +6,7 @@ from frequenz.repo.config.mkdocs.mkdocstrings_macros import hook_env_with_everything from griffe import ModulesCollection, Object from mkdocs_macros.plugin import MacrosPlugin -from mkdocstrings_handlers.python.handler import PythonHandler +from mkdocstrings_handlers.python import PythonHandler def define_env(env: MacrosPlugin) -> None: @@ -47,8 +47,7 @@ def docstring_summary(symbol: str) -> str: """ docstring = _get_docstring(symbol) summary = docstring.splitlines(keepends=False)[0] - # The python_handler is untyped here, so ignore the type - return python_handler.do_convert_markdown( # type: ignore[no-any-return] + return python_handler.do_convert_markdown( summary, heading_level=1, strip_paragraph=True ) diff --git a/pyproject.toml b/pyproject.toml index 122c5187..98afa782 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ dev-mkdocs = [ "mkdocs-macros-plugin == 1.5.0", "mkdocs-material == 9.7.6", "mkdocstrings[python] == 1.0.4", - "mkdocstrings-python == 1.18.2", + "mkdocstrings-python == 2.0.3", "pymdownx-superfence-filter-lines == 0.1.0", "griffe==2.0.2", ]