From 664ea543449d51510aec8b58f8676a215504dc9a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:31:45 +0200 Subject: [PATCH] Check suprocess return codes on RDT generation (#795) (#796) * Check subprocess return codes on RDT generation (#795) Signed-off-by: eduponz (cherry picked from commit 0974196bd09151b49d3a9a39983b02506054635f) * Refs #21114: Remove unsued Doxyfile EXAMPLE_PATH Signed-off-by: eduponz * Refs #21114: Fix Fast DDS Python API reference warnings regarding Qos aliases Signed-off-by: eduponz * Refs #21114: Fail generation when docutils errors Signed-off-by: eduponz * Refs #21114: Use correct branches of Fast DDS and Fast DDS Python in RTD Signed-off-by: eduponz --------- Signed-off-by: eduponz Co-authored-by: Eduardo Ponz Segrelles --- code/doxygen-config.in | 2 +- docs/conf.py | 38 ++++++++----------- docs/docutils.conf | 2 + .../dds_pim/domain/domainparticipantqos.rst | 3 +- .../dds_pim/publisher/datawriterqos.rst | 4 +- .../dds_pim/publisher/publisherqos.rst | 2 +- .../dds_pim/subscriber/datareaderqos.rst | 4 +- .../dds_pim/subscriber/subscriberqos.rst | 2 +- .../dds_pim/topic/topicqos.rst | 2 +- 9 files changed, 26 insertions(+), 33 deletions(-) create mode 100644 docs/docutils.conf diff --git a/code/doxygen-config.in b/code/doxygen-config.in index 347b7ff1c..afff4aef4 100644 --- a/code/doxygen-config.in +++ b/code/doxygen-config.in @@ -985,7 +985,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/code +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and diff --git a/docs/conf.py b/docs/conf.py index 92ccb2494..5e2b80d87 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -216,22 +216,13 @@ def configure_doxyfile( fastdds_branch = os.environ.get('FASTDDS_BRANCH', None) # First try to checkout to ${FASTDDS_BRANCH} - # Else try with current documentation branch - # Else checkout to master + # Else checkout to 2.14.x if (fastdds_branch and fastdds.refs.__contains__('origin/{}'.format(fastdds_branch))): fastdds_branch = 'origin/{}'.format(fastdds_branch) - elif (docs_branch and - fastdds.refs.__contains__('origin/{}'.format(docs_branch))): - fastdds_branch = 'origin/{}'.format(docs_branch) else: - print( - 'Fast DDS does not have either "{}" or "{}" branches'.format( - fastdds_branch, - docs_branch - ) - ) - fastdds_branch = 'origin/master' + fastdds_branch = 'origin/2.14.x' + print(f'Fast DDS branch is not set by env var. Using "{fastdds_branch}"') # Actual checkout print('Checking out Fast DDS branch "{}"'.format(fastdds_branch)) @@ -248,20 +239,14 @@ def configure_doxyfile( fastdds_python_branch = os.environ.get('FASTDDS_PYTHON_BRANCH', None) # First try to checkout to ${FASTDDS_PYTHON_BRANCH} - # Else try with current documentation branch - # Else checkout to master + # Else checkout to 1.4.x if (fastdds_python_branch and fastdds_python.refs.__contains__( 'origin/{}'.format(fastdds_python_branch))): fastdds_python_branch = 'origin/{}'.format(fastdds_python_branch) - elif (docs_branch and - fastdds_python.refs.__contains__('origin/{}'.format(docs_branch))): - fastdds_python_branch = 'origin/{}'.format(docs_branch) else: - print( - 'Fast DDS Python does not have either "{}" or "{}" branches' - .format(fastdds_python_branch, docs_branch)) - fastdds_python_branch = 'origin/main' + fastdds_python_branch = 'origin/1.4.x' + print(f'Fast DDS Python branch is not set by env var. Using "{fastdds_python_branch}"') # Actual checkout print('Checking out Fast DDS Python branch "{}"'.format( @@ -285,10 +270,13 @@ def configure_doxyfile( project_source_dir ) # Generate doxygen documentation - subprocess.call('doxygen {}'.format(doxyfile_out), shell=True) + doxygen_ret = subprocess.call('doxygen {}'.format(doxyfile_out), shell=True) + if doxygen_ret != 0: + print('Doxygen failed with return code {}'.format(doxygen_ret)) + sys.exit(doxygen_ret) # Generate SWIG code. - subprocess.call('swig -python -doxygen -I{}/include \ + swig_ret = subprocess.call('swig -python -doxygen -I{}/include \ -outdir {}/fastdds_python/src/swig -c++ -interface \ _fastdds_python -o \ {}/fastdds_python/src/swig/fastddsPYTHON_wrap.cxx \ @@ -298,6 +286,10 @@ def configure_doxyfile( fastdds_python_repo_name, fastdds_python_repo_name ), shell=True) + if swig_ret != 0: + print('SWIG failed with return code {}'.format(swig_ret)) + sys.exit(swig_ret) + fastdds_python_imported_location = '{}/fastdds_python/src/swig'.format( fastdds_python_repo_name) autodoc_mock_imports = ["_fastdds_python"] diff --git a/docs/docutils.conf b/docs/docutils.conf new file mode 100644 index 000000000..411124c2a --- /dev/null +++ b/docs/docutils.conf @@ -0,0 +1,2 @@ +[general] +halt_level: 2 diff --git a/docs/fastdds/python_api_reference/dds_pim/domain/domainparticipantqos.rst b/docs/fastdds/python_api_reference/dds_pim/domain/domainparticipantqos.rst index 8c3cef901..74c18e734 100644 --- a/docs/fastdds/python_api_reference/dds_pim/domain/domainparticipantqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/domain/domainparticipantqos.rst @@ -8,5 +8,4 @@ DomainParticipantQos .. autoclass:: fastdds.DomainParticipantQos -.. TODO - .. autoclass:: fastdds.PARTICIPANT_QOS_DEFAULT +.. autodata:: fastdds.PARTICIPANT_QOS_DEFAULT diff --git a/docs/fastdds/python_api_reference/dds_pim/publisher/datawriterqos.rst b/docs/fastdds/python_api_reference/dds_pim/publisher/datawriterqos.rst index afbc3195f..d6fd04481 100644 --- a/docs/fastdds/python_api_reference/dds_pim/publisher/datawriterqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/publisher/datawriterqos.rst @@ -7,6 +7,6 @@ DataWriterQos .. autoclass:: fastdds.DataWriterQos -.. autoclass:: fastdds.DATAWRITER_QOS_DEFAULT +.. autodata:: fastdds.DATAWRITER_QOS_DEFAULT -.. autoclass:: fastdds.DATAWRITER_QOS_USE_TOPIC_QOS +.. autodata:: fastdds.DATAWRITER_QOS_USE_TOPIC_QOS diff --git a/docs/fastdds/python_api_reference/dds_pim/publisher/publisherqos.rst b/docs/fastdds/python_api_reference/dds_pim/publisher/publisherqos.rst index 71073d4c6..c9913cc4d 100644 --- a/docs/fastdds/python_api_reference/dds_pim/publisher/publisherqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/publisher/publisherqos.rst @@ -7,4 +7,4 @@ PublisherQos .. autoclass:: fastdds.PublisherQos -.. autoclass:: fastdds.PUBLISHER_QOS_DEFAULT +.. autodata:: fastdds.PUBLISHER_QOS_DEFAULT diff --git a/docs/fastdds/python_api_reference/dds_pim/subscriber/datareaderqos.rst b/docs/fastdds/python_api_reference/dds_pim/subscriber/datareaderqos.rst index 5d50a7abc..1ed99a0ce 100644 --- a/docs/fastdds/python_api_reference/dds_pim/subscriber/datareaderqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/subscriber/datareaderqos.rst @@ -7,6 +7,6 @@ DataReaderQos .. autoclass:: fastdds.DataReaderQos -.. autoclass:: fastdds.DATAREADER_QOS_DEFAULT +.. autodata:: fastdds.DATAREADER_QOS_DEFAULT -.. autoclass:: fastdds.DATAREADER_QOS_USE_TOPIC_QOS +.. autodata:: fastdds.DATAREADER_QOS_USE_TOPIC_QOS diff --git a/docs/fastdds/python_api_reference/dds_pim/subscriber/subscriberqos.rst b/docs/fastdds/python_api_reference/dds_pim/subscriber/subscriberqos.rst index 48ea76696..baca2bb63 100644 --- a/docs/fastdds/python_api_reference/dds_pim/subscriber/subscriberqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/subscriber/subscriberqos.rst @@ -7,4 +7,4 @@ SubscriberQos .. autoclass:: fastdds.SubscriberQos -.. autoclass:: fastdds.SUBSCRIBER_QOS_DEFAULT +.. autodata:: fastdds.SUBSCRIBER_QOS_DEFAULT diff --git a/docs/fastdds/python_api_reference/dds_pim/topic/topicqos.rst b/docs/fastdds/python_api_reference/dds_pim/topic/topicqos.rst index db6dfe0c0..9a57cdb67 100644 --- a/docs/fastdds/python_api_reference/dds_pim/topic/topicqos.rst +++ b/docs/fastdds/python_api_reference/dds_pim/topic/topicqos.rst @@ -7,4 +7,4 @@ TopicQos .. autoclass:: fastdds.TopicQos -.. autoclass:: fastdds.TOPIC_QOS_DEFAULT +.. autodata:: fastdds.TOPIC_QOS_DEFAULT