Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typehints and Mocks #193

Open
stonier opened this issue Feb 1, 2023 · 1 comment
Open

Typehints and Mocks #193

stonier opened this issue Feb 1, 2023 · 1 comment

Comments

@stonier
Copy link
Member

stonier commented Feb 1, 2023

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

@stonier
Copy link
Member Author

stonier commented Feb 2, 2023

  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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant