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

documentation build fixes for ReadTheDocs #450

Merged
merged 21 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8b159c7
pin jinja2<3.1
tomkinsc Jan 18, 2023
e777c0d
override sphinx pinning done by RTD
tomkinsc Jan 18, 2023
9630bd4
(debugging) omit jinja2 pinning
tomkinsc Jan 18, 2023
9039a7b
list jinja2 in requirements but without a version pin
tomkinsc Jan 18, 2023
86dc2b2
set sphinx builder to "html" in the RTD config
tomkinsc Jan 18, 2023
32d10b8
omit sphinx autodoc since this repo is for wdls not pythons
tomkinsc Jan 18, 2023
d930695
Update requirements.txt
tomkinsc Jan 18, 2023
0f68d52
Update requirements.txt
tomkinsc Jan 18, 2023
0203fa7
bump RTD python 3.6->3.8
tomkinsc Jan 18, 2023
d5623ad
comment out wdl_aid import in sphinx config
tomkinsc Jan 18, 2023
e399fcd
try always explicitly specifying the sphinx_rtd_theme
tomkinsc Jan 18, 2023
0e651a2
revert toggle of RTD sphinx theme based on build environment
tomkinsc Jan 18, 2023
aecd7f0
pass through error code on build-docs.sh failure
tomkinsc Jan 18, 2023
b909243
invert
tomkinsc Jan 18, 2023
2331a5d
remove whitespace before sphinx config imports
tomkinsc Jan 18, 2023
a518305
capture and print wdl-aid output upon error
tomkinsc Jan 18, 2023
ca1fd20
pip freeze after installing docs dependencies on GH actions
tomkinsc Jan 18, 2023
0655ee7
bump python to 3.11 for RTD and GH Actions doc builds
tomkinsc Jan 18, 2023
290c689
explicitly pin most of the documentation build requirements
tomkinsc Jan 18, 2023
8327300
roll back python used for doc builds to 3.8
tomkinsc Jan 18, 2023
7e4bd02
add back sphinx autodoc extension
tomkinsc Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ jobs:
github_actions_ci/validate-wdl-womtool.sh

## note: this test_docs job does not actually produce the output on readthedocs
## readthedocs does its own build trigger. this travis job exists simply to alert us
## of build failures of the docs because otherwise we would never know.
## readthedocs does its own build trigger. this job exists simply to
## attempt a build and alert us of documentation build failures because otherwise we would never know.
test_docs:
runs-on: ubuntu-20.04
steps:
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py

# Build documentation with MkDocs
Expand All @@ -18,6 +19,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.6
version: 3.8
install:
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
20 changes: 16 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import subprocess
Expand Down Expand Up @@ -48,8 +47,21 @@ def _make_wdl_markdowns():
fname_base = os.path.basename(wf)
if fname_base.endswith('.wdl'):
fname_base = fname_base[:-4]
subprocess.check_call(['wdl-aid', '-o', fname_base+'.md', os.path.join(wf_dir, wf)])
outf.write(" {}\n".format(fname_base))
try:
# generate markdown file for specific wdl
subprocess.run([
'wdl-aid',
'-o', fname_base+'.md',
os.path.join(wf_dir, wf)
],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
# add entry for the wdl to the main markdown file
outf.write(" {}\n".format(fname_base))
except subprocess.CalledProcessError as e:
print ( f"Error({e.returncode}):\n{e.output.decode('utf-8')}" )
raise
outf.write("\n")
_make_wdl_markdowns()

Expand Down Expand Up @@ -77,7 +89,7 @@ def _make_wdl_markdowns():

# General information about the project.
project = 'viral-ngs'
copyright = '2014, Broad Institute Viral Genomics'
copyright = '2023, Broad Institute Viral Genomics'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
12 changes: 7 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Sphinx
jinja2==3.1.2 # https://github.com/readthedocs/readthedocs.org/issues/9037#issuecomment-1077818554
Sphinx==5.3.0 #override sphinx pinning done by RTD: https://docs.readthedocs.io/en/stable/build-default-versions.html#external-dependencies
sphinx-argparse
sphinx_rtd_theme
PyYAML
mock
sphinx-rtd-theme==1.1.1
PyYAML==6.0
mock==5.0.1
recommonmark
wdl-aid
miniwdl==1.8.0
wdl-aid==1.0.0
11 changes: 10 additions & 1 deletion github_actions_ci/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
set -e

pushd docs
make html && echo "Docs built successfully!" || echo "Docs did NOT build successfully."

make html

build_exit_code=$?
if [ $build_exit_code -eq 0 ]; then
echo "Docs built successfully"
else
echo "Docs did NOT build successfully"
exit $build_exit_code
fi
popd
3 changes: 3 additions & 0 deletions github_actions_ci/install-pip-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

echo "pip installing test-related packages (Sphinx, etc.)"
pip install --quiet -r docs/requirements.txt

# list what was installed
pip freeze