splintered-reality/py_trees_ros

Typehints and Mocks

Opened this issue · 1 comments

Doesn't work with the builtin autodoc version of typehints.

  1. 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'>) 
  1. No humble version of rclpy api? Getting foxy for now

  2. I use typing.Any liberally

  1. 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

  1. With the mocks on a typehinted field:
  1. No humble version of rclpy api? Getting foxy for now
  1. I use typing.Any liberally