Skip to content

Commit f7ccf8a

Browse files
committed
docs: fix build
1 parent b448116 commit f7ccf8a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/sources/_extensions/autoapi_kivymd.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from autoapi.extension import LOGGER
2222
from autoapi.extension import setup as autoapi_setup
2323
from autoapi.mappers.python.mapper import PythonSphinxMapper
24+
from autoapi.mappers.python.parser import Parser
2425
from autoapi.mappers.python.objects import PythonPythonMapper
2526
from docutils import nodes
2627
from sphinx.util.console import bold, darkgreen
@@ -109,6 +110,15 @@ def PythonSphinxMapper_output_rst(
109110
self._output_top_rst(root)
110111

111112

113+
def PythonSphinxMapper_read_file(self : PythonSphinxMapper, path, **kwargs):
114+
dir_root = kwargs.get("dir_root")
115+
if self._use_implicit_namespace:
116+
parsed_data = Parser().parse_file_in_namespace(path, dir_root)
117+
else:
118+
parsed_data = Parser().parse_file(path)
119+
return parsed_data
120+
121+
112122
def extension_build_finished(app, exception):
113123
if (
114124
not app.config.autoapi_keep_files
@@ -150,5 +160,6 @@ def setup(app):
150160
PythonPythonMapper.pathname = property(PythonPythonMapper_pathname)
151161
PythonPythonMapper.include_dir = PythonPythonMapper_include_dir
152162
PythonSphinxMapper.output_rst = PythonSphinxMapper_output_rst
163+
PythonSphinxMapper.read_file = PythonSphinxMapper_read_file
153164
autoapi.extension.build_finished = extension_build_finished
154165
autoapi_setup(app)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def glob_paths(pattern):
120120
"docs": [
121121
"sphinx==7.3.7",
122122
"sphinx-autoapi==3.0.0",
123+
"astroid<2.12",
123124
# "furo",
124125
"sphinx-book-theme",
125126
"sphinx-notfound-page",

0 commit comments

Comments
 (0)