You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mkapi aborts generation with "RecursionError: maximum recursion depth exceeded" for an Enum class with about more than 960 enumeration values (narrowed down from originally ~5800 values).
src/my_pkg/my_enum.py:
fromenumimportEnum, autoclassMyEnum(Enum):
VALUE_1=auto()
VALUE_2=auto()
# ... and more ...
> mkdocs build --strict
INFO - Cleaning site directory
INFO - Building documentation to directory: .<path\to>\_build\docs
WARNING - MkAPI: api/my_pkg/README.md:RecursionError: maximum recursion depth exceeded
INFO - Doc file 'src/my_pkg.md' contains a link '../api/my_pkg/README.md#my_pkg', but the doc 'api/my_pkg/README.md' does not contain an anchor '#my_pkg'.
Aborted with 1 warnings in strict mode!
Excluding this file from docs is acceptable, but using the exclude option does not resolve the issue.
Below traceback appears if there are more than ~970 values.
Full traceback
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "<path\to>\.tox\docs\Scripts\mkdocs.EXE\__main__.py", line 7, in <module>
File "<path\to>\.tox\docs\Lib\site-packages\click\core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\click\core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\click\core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\click\core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\click\core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkdocs\__main__.py", line 288, in build_command
build.build(cfg, dirty=not clean)
File "<path\to>\.tox\docs\Lib\site-packages\mkdocs\commands\build.py", line 292, in build
files = config.plugins.on_files(files, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkdocs\plugins.py", line 593, in on_files
return self.run_event('files', files, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkdocs\plugins.py", line 566, in run_event
result = method(item, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\plugin.py", line 67, in on_files
page.generate_markdown()
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\page.py", line 81, in generate_markdown
self.markdown, names = generate_module_markdown(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\page.py", line 126, in generate_module_markdown
for name, _ in get_module_members(module, private=False, special=False):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 473, in get_module_members
members = list(iter_module_members(module, private, special, child_only=child_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 514, in iter_module_members
for name, obj in _iter_module_members(module, child_only):
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 555, in _iter_module_members
yield from _iter_children_from_definition(obj, name)
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 587, in _iter_children_from_definition
for child in get_child_nodes(obj.node, obj.module):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 306, in get_child_nodes
for child in iter_child_nodes(node, module):
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\node.py", line 154, in iter_child_nodes
for child in mkapi.ast.iter_child_nodes(node):
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\ast.py", line 82, in iter_child_nodes
yield from _iter_assign_nodes(child, it)
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\ast.py", line 142, in _iter_assign_nodes
yield from _iter_assign_nodes(next_node, it)
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\ast.py", line 142, in _iter_assign_nodes
yield from _iter_assign_nodes(next_node, it)
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\ast.py", line 142, in _iter_assign_nodes
yield from _iter_assign_nodes(next_node, it)
[Previous line repeated 971 more times]
File "<path\to>\.tox\docs\Lib\site-packages\mkapi\ast.py", line 135, in _iter_assign_nodes
next_node = next(it)
^^^^^^^^
RecursionError: maximum recursion depth exceeded
Environment:
Python: 3.12.5
tox: 4.23.2
mkapi: 3.0.22
The text was updated successfully, but these errors were encountered:
mkapi aborts generation with "RecursionError: maximum recursion depth exceeded" for an Enum class with about more than 960 enumeration values (narrowed down from originally ~5800 values).
src/my_pkg/my_enum.py
:Excluding this file from docs is acceptable, but using the exclude option does not resolve the issue.
Below traceback appears if there are more than ~970 values.
Full traceback
Environment:
The text was updated successfully, but these errors were encountered: