Skip to content

Commit 5ba50a1

Browse files
committed
fix(docs): mock rcl_interfaces to fix empty Node API page
rclpy.node uniquely imports rcl_interfaces.msg (for parameter message types such as FloatingPointRange, ParameterDescriptor, etc.) which in turn requires rosidl_pycommon.interface_base_classes — a package not available in the Sphinx/rosdoc2 docs build environment. Without this mock, autodoc silently fails to import rclpy.node and renders an empty page showing only the 'Node' section heading. Every other module (publisher, client, clock, etc.) avoids this because they don't directly import rcl_interfaces.msg at module level. The regression was introduced when BaseNode was extracted as an ABC (#1637), which moved the rcl_interfaces imports into a module that autodoc must import standalone (previously they were pulled in lazily through rclpy's own initialization chain). Fixes: #1681 Assisted-by: Gemini CLI:Claude Sonnet 4.6 (Thinking) [gh, read_url_content, grep_search, run_command]
1 parent 8593246 commit 5ba50a1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rclpy/docs/source/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,9 @@
202202
'members': True, # document members
203203
'undoc-members': True, # also document members without documentation
204204
}
205+
206+
# rclpy.node imports rcl_interfaces.msg (for parameter message types) which requires
207+
# rosidl_pycommon, a package not available in the Sphinx docs build environment.
208+
# Without this mock the entire rclpy.node module fails to import and autodoc silently
209+
# produces an empty page for the Node API.
210+
autodoc_mock_imports = ['rcl_interfaces']

0 commit comments

Comments
 (0)