From d15bcdeb2b19792b694579dd498538f079d4faf1 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sun, 10 Sep 2023 20:14:37 -0400 Subject: [PATCH] ReadTheDocs CI builds updates Since RTD doesn't run autogen, configure, or make, we now have to manually copy a few RST files from the embedded PRRTE to the docs/ tree before RTD invokes Sphinx. Signed-off-by: Jeff Squyres --- .readthedocs-pre-create-environment.sh | 31 ++++++++++++++++++++++++++ .readthedocs.yaml | 9 ++++++++ 2 files changed, 40 insertions(+) create mode 100755 .readthedocs-pre-create-environment.sh diff --git a/.readthedocs-pre-create-environment.sh b/.readthedocs-pre-create-environment.sh new file mode 100755 index 00000000000..790c15e4707 --- /dev/null +++ b/.readthedocs-pre-create-environment.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -euxo pipefail + +env | sort + +# The ReadTheDocs build process does not run autogen/configure/make. +# Hence, we have to copy the PRRTE RST files (from the 3rd-party/prrte +# tree) to our docs/ tree manually. + +SCHIZO_SRC_DIR=3rd-party/prrte/src/mca/schizo/ompi +SCHIZO_TARGET_DIR=docs/schizo-ompi-rst-content + +PRRTE_RST_SRC_DIR=3rd-party/prrte/src/docs/prrte-rst-content +PRRTE_RST_TARGET_DIR=docs/prrte-rst-content + +# Copy the OMPI schizo file from PRRTE + +cp -rp $SCHIZO_SRC_DIR $SCHIZO_TARGET_DIR + +# Only copy the PRRTE RST source files in prrte-rst-content that are +# referenced by ".. include::" in the schizo-ompi-cli.rst file. We do +# this because Sphinx complains if there are .rst files that are not +# referenced. :-( + +mkdir -p $PRRTE_RST_TARGET_DIR +files=`fgrep '.. include::' $SCHIZO_TARGET_DIR/schizo-ompi-cli.rst | awk '{ print $3 }'` +for file in $files; do + filename=`basename $file` + cp -pf $PRRTE_RST_SRC_DIR/$filename $PRRTE_RST_TARGET_DIR +done diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 44e0bbac5a7..e3c4a048c56 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,6 +12,12 @@ build: os: ubuntu-22.04 tools: python: "3.10" + jobs: + # RTD doesn't run configure or make. So we have to manually copy + # in the PRRTE RST files to docs/. + pre_create_environment: + - echo This is pre_create_environment + - ./.readthedocs-pre-create-environment.sh python: install: @@ -21,3 +27,6 @@ python: sphinx: configuration: docs/conf.py fail_on_warning: true + +submodules: + include: all