ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
126 stars 144 forks source link

[rosdoc2] Fix document generation on buildfarm #701

Closed Yadunund closed 1 year ago

Yadunund commented 1 year ago

Doc job on buildfarm is failing for launch with the error below

21:11:15     import logging
21:11:15   File "/tmp/ws/docs_build/launch/launch/logging/__init__.py", line 21, in <module>
21:11:15     import logging.handlers
21:11:15   File "/tmp/ws/docs_build/launch/launch/logging/handlers.py", line 79, in <module>
21:11:15     sys.modules[__name__] = _module_wrapper(sys.modules[__name__])
21:11:15   File "/tmp/ws/docs_build/launch/launch/logging/handlers.py", line 61, in __init__
21:11:15     for module in (logging, logging.handlers):
21:11:15 AttributeError: partially initialized module 'logging' has no attribute 'handlers' (most likely due to a circular import)

This reason and fix for this is described here https://github.com/ros-infrastructure/rosdoc2/pull/52

This PR updates the path added to sys.path within conf.py. With the PR above, the entire module folder will be copied over to the same location as this conf.py file within docs_build/. Hence, we need to append the current working dir to the sys.path such that the modules can be imported correctly.

In addition to this, added lark as a <doc_depend> to explicitly mock lark imports since rosdoc2 will mock lark-parser given that the rosdep key is python3-lark-parser.

Yadunund commented 1 year ago

CI: