Skip to content

Commit c356981

Browse files
committed
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 <[email protected]>
1 parent 1fd0944 commit c356981

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# The ReadTheDocs build process does not run autogen/configure/make.
6+
# Hence, we have to copy the PRRTE RST files (from the 3rd-party/prrte
7+
# tree) to our docs/ tree manually.
8+
9+
# Ensure that we're in the RTD CI environment
10+
11+
if [[ "${READTHEDOCS:-no}" == "no" ]]; then
12+
echo "This script is only intended to be run in the ReadTheDocs CI environment"
13+
exit 1
14+
fi
15+
16+
SCHIZO_SRC_DIR=3rd-party/prrte/src/mca/schizo/ompi
17+
SCHIZO_TARGET_DIR=docs/schizo-ompi-rst-content
18+
19+
PRRTE_RST_SRC_DIR=3rd-party/prrte/src/docs/prrte-rst-content
20+
PRRTE_RST_TARGET_DIR=docs/prrte-rst-content
21+
22+
# Copy the OMPI schizo file from PRRTE
23+
24+
cp -rp $SCHIZO_SRC_DIR $SCHIZO_TARGET_DIR
25+
26+
# Only copy the PRRTE RST source files in prrte-rst-content that are
27+
# referenced by ".. include::" in the schizo-ompi-cli.rst file. We do
28+
# this because Sphinx complains if there are .rst files that are not
29+
# referenced. :-(
30+
31+
mkdir -p $PRRTE_RST_TARGET_DIR
32+
files=`fgrep '.. include::' $SCHIZO_TARGET_DIR/schizo-ompi-cli.rstxt | awk '{ print $3 }'`
33+
for file in $files; do
34+
filename=`basename $file`
35+
cp -pf $PRRTE_RST_SRC_DIR/$filename $PRRTE_RST_TARGET_DIR
36+
done

.readthedocs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ build:
1212
os: ubuntu-22.04
1313
tools:
1414
python: "3.10"
15+
jobs:
16+
# RTD doesn't run configure or make. So we have to manually copy
17+
# in the PRRTE RST files to docs/.
18+
pre_create_environment:
19+
- ./.readthedocs-pre-create-environment.sh
1520

1621
python:
1722
install:
@@ -21,3 +26,6 @@ python:
2126
sphinx:
2227
configuration: docs/conf.py
2328
fail_on_warning: true
29+
30+
submodules:
31+
include: all

0 commit comments

Comments
 (0)