Skip to content

sphinx autodoc is failing with launch and launch_ros #154

@rkent

Description

@rkent

both launch and launch_ros packages generate no use useful API documentation. In the launch_ros case, the error is in typing.

See also ros2/launch_ros#232

Typical error:

WARNING: autodoc: failed to import module 'launch_ros'; the following exception was raised:
Traceback (most recent call last):
  File "/workspace/venv/lib/python3.10/site-packages/sphinx/ext/autodoc/importer.py", line 143, in import_module
    return importlib.import_module(modname)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data2/repos/humble/humble/launch_ros/launch_ros/launch_ros/__init__.py", line 17, in <module>
    from . import actions
  File "/data2/repos/humble/humble/launch_ros/launch_ros/launch_ros/actions/__init__.py", line 17, in <module>
    from .composable_node_container import ComposableNodeContainer
  File "/data2/repos/humble/humble/launch_ros/launch_ros/launch_ros/actions/composable_node_container.py", line 27, in <module>
    from .node import Node
  File "/data2/repos/humble/humble/launch_ros/launch_ros/launch_ros/actions/node.py", line 48, in <module>
    from launch_ros.parameters_type import SomeParameters
  File "/data2/repos/humble/humble/launch_ros/launch_ros/launch_ros/parameters_type.py", line 50, in <module>
    SomeSubstitutionsType_types_tuple +
TypeError: unsupported operand type(s) for +: 'SomeSubstitutionsType_types_tuple' and 'tuple'
 [autodoc.import_object]

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