33# For the full list of built-in configuration values, see the documentation:
44# https://www.sphinx-doc.org/en/master/usage/configuration.html
55
6+ from __future__ import annotations
7+
68import os
79import sys
810
11+ from sphinx .application import Sphinx
12+
913# Add the src directory to the path so we can import the package
1014sys .path .insert (0 , os .path .abspath ("../src" ))
1115
5559autodoc_typehints_description_target = "documented"
5660
5761
58- def _inject_type_submodules (app , docname , source ) :
62+ def _inject_type_submodules (_app : Sphinx , docname : str , source : list [ str ]) -> None :
5963 """Auto-generate automodule directives for all type submodules.
6064
6165 Replaces the ``.. auto-all-types::`` placeholder in types.rst with
@@ -70,23 +74,19 @@ def _inject_type_submodules(app, docname, source):
7074
7175 import runloop_api_client .types as types_pkg
7276
73- directives = []
77+ directives : list [ str ] = []
7478 for _ , modname , ispkg in sorted (
7579 pkgutil .walk_packages (types_pkg .__path__ , types_pkg .__name__ + "." ),
7680 key = lambda x : x [1 ],
7781 ):
7882 if ispkg :
7983 continue
80- directives .append (
81- f".. automodule:: { modname } \n "
82- f" :members:\n "
83- f" :undoc-members:\n "
84- )
84+ directives .append (f".. automodule:: { modname } \n :members:\n :undoc-members:\n " )
8585 source [0 ] = source [0 ].replace (".. auto-all-types::" , "\n " .join (directives ))
8686
8787
88- def setup (app ) :
89- app .connect ("source-read" , _inject_type_submodules )
88+ def setup (app : Sphinx ) -> None :
89+ app .connect ("source-read" , _inject_type_submodules ) # pyright: ignore[reportUnknownMemberType]
9090
9191
9292# Intersphinx mapping
0 commit comments