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

⚡ faster RtD build #15

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 28 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,34 @@ formats:
build:
os: ubuntu-22.04
tools:
python: "3.11"
apt_packages:
- imagemagick
- inkscape
- graphviz
python: "3.12"
commands:
# Skip docs build if the commit message contains "skip ci"
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
# Skip docs build if there are no changes related to docs
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ src/python include/*/python .github/contributing* .github/support*;
then
exit 183;
fi
# Set up uv and a virtual environment
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv
# Install the project dependencies
- uv pip install -r docs/requirements.txt readthedocs-sphinx-ext
# Run the html builder
- .venv/bin/python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
# Run the htmlzip builder and create a zip file
- .venv/bin/python -m sphinx -T -b dirhtml -d docs/_build/doctrees -D language=en docs docs/_build/dirhtml
- mkdir -p $READTHEDOCS_OUTPUT/htmlzip
- zip -r $READTHEDOCS_OUTPUT/htmlzip/html.zip docs/_build/dirhtml/*
# Run the latex builder and create a pdf file
- .venv/bin/python -m sphinx -T -b latex -d docs/_build/doctrees -D language=en docs docs/_build/latex
- cd docs/_build/latex && latexmk -pdf -f -dvi- -ps- -interaction=nonstopmode -jobname=mqt_handbook
- mkdir -p $READTHEDOCS_OUTPUT/pdf
- cp docs/_build/latex/mqt_handbook.pdf $READTHEDOCS_OUTPUT/pdf/mqt_handbook.pdf

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"myst_nb",
"sphinx.ext.intersphinx",
"sphinxcontrib.bibtex",
"sphinxcontrib.inkscapeconverter",
"sphinxcontrib.cairosvgconverter",
"sphinx_design",
"sphinx_copybutton",
"sphinxext.opengraph",
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ sphinx>=5
sphinx-copybutton
sphinx_design
sphinxcontrib-bibtex>=2.4.2
sphinxcontrib-svg2pdfconverter
sphinxcontrib-svg2pdfconverter[CairoSVG]
sphinxext-opengraph