Typehints and Mocks
Opened this issue · 1 comments
stonier commented
Doesn't work with the builtin autodoc version of typehints.
- I intersphinx rclpy, but without mocks, it has errors. Note, calling out the type in the param field works, but not typehints.
Failed to import py_trees_ros.programs.tree_watcher.
Possible hints:
* ModuleNotFoundError: No module named 'rclpy'
* KeyError: 'py_trees_ros'
With the mocks on a typehinted field:
qos_profile (<Mock name='mock.qos.QoSProfile' id='139901457227712'>)
-
No humble version of rclpy api? Getting foxy for now
-
I use
typing.Any
liberally
stonier commented
- I intersphinx rclpy, but without mocks, it has errors. Note, calling out the type in the param field works, but not typehints.
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
Fixed in #192
- With the mocks on a typehinted field:
- No humble version of rclpy api? Getting foxy for now
- I use typing.Any liberally