Skip to content

astroid 3 breaks builds: AttributeError: 'Module' object has no attribute 'doc' #31

@thewtex

Description

@thewtex

I am not sure if this an astroid or autodoc2 issue, but the astroid 3 release broke builds.

Example error:


Running Sphinx v7.2.6
making output directory... done
�[2K[Autodoc2] Analysing package...[  5%] itkwasm.pixel_types
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/autodoc2/sphinx/extension.py", line 76, in run_autodoc
    mod_path = run_autodoc_package(app, config, i)
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/autodoc2/sphinx/extension.py", line 164, in run_autodoc_package
    for data in analyse_module(mod_path, mod_name):
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/autodoc2/analysis.py", line 41, in analyse_module
    yield from walk_node(
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/autodoc2/analysis.py", line 105, in walk_node
    yield from func(node, state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/autodoc2/analysis.py", line 116, in yield_module
    "doc": fix_docstring_indent(node.doc),
AttributeError: 'Module' object has no attribute 'doc'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/sphinx/cmd/build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/sphinx/application.py", line 272, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/sphinx/application.py", line 343, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/itkwasm/envs/latest/lib/python3.10/site-packages/sphinx/events.py", line 108, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function run_autodoc at 0x7f69dd1211b0> for event 'builder-inited' threw an exception (exception: 'Module' object has no attribute 'doc')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions