Skip to content

Commit 98ef790

Browse files
docs / tox: Build documentation to check for errors
Signed-off-by: Bernhard Kaindl <[email protected]>
1 parent 75054b3 commit 98ef790

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ repos:
102102
name: pytest unit tests and static analysis using tox
103103
types: [python]
104104
# entry: sh -c "pytest -x -rf --new-first --show-capture=all >/dev/tty"
105-
entry: sh -c "tox -e py311-cov-check-pytype-pyright-lint-mdreport >/dev/tty"
105+
entry: sh -c "tox -e py311-cov-check-pytype-pyright-lint-docs-mdreport >/dev/tty"
106106
verbose: true
107107
language: python
108108
require_serial: true

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@
5555
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
5656

5757
html_theme = "furo"
58-
html_static_path = ["_static"]
58+
# No static html source files for now.
59+
# html_static_path = ["_static"]

tox.ini

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ min_version = 4.6
1212
# .github/workflows/main.yml is set up to test with 3.11, 3.12 and 3.13 in parallel.
1313
# Therefore, use three environments: One with 3.11, one with 3.12 and one with 3.13:
1414
#
15-
envlist = py311-covcp-check-pytype-mdreport, py312-cov, py313-cov-lint-pyright
15+
envlist = py311-covcp-check-pytype-mdreport, py312-cov-docs, py313-cov-lint-pyright
1616
isolated_build = true
1717
skip_missing_interpreters = true
1818
requires =
@@ -37,6 +37,7 @@ commands =
3737
description = Run in a {basepython} virtualenv:
3838
cov: {[cov]description}
3939
covcp: Copy the generated .converage and coverage.xml to the UPLOAD_DIR dir
40+
docs: {[docs]description}
4041
fox: {[fox]description}
4142
lint: {[lint]description}
4243
mdreport: Make a test report (which is shown in the GitHub Actions Summary Page)
@@ -56,12 +57,14 @@ deps =
5657
{cov,covcp,fox}: coverage[toml]
5758
{cov,covcp,fox}: diff-cover
5859
{lint,fox}: {[lint]deps}
60+
docs: {[docs]deps}
5961
pyright: pyright
6062
allowlist_externals =
6163
{cov,covcp,fox,check,lint,test,mdreport}: echo
6264
{cov,covcp,fox,check,lint,test,mdreport}: sh
6365
{cov,covcp,fox}: cp
6466
check: cat
67+
docs: make
6568
fox: firefox
6669
passenv =
6770
{pytype,lint,test}: GITHUB_STEP_SUMMARY
@@ -99,6 +102,7 @@ setenv =
99102
lint: ENVLOGDIR={envlogdir}
100103
{[cov]setenv}
101104
commands =
105+
docs: {[docs]commands}
102106
lint: {[lint]commands}
103107
pyright: {[pyright]commands}
104108
check: {[check]commands}
@@ -126,6 +130,13 @@ commands =
126130
--html-report {envlogdir}/coverage-diff.html \
127131
{envlogdir}/coverage.xml
128132

133+
134+
[docs]
135+
description = Build the documentation to check for errors
136+
deps = -r docs/requirements.txt
137+
commands = make -C docs html SPHINXOPTS="--fail-on-warning"
138+
139+
129140
[lint]
130141
description = Run pylint and fail on warnings remaining on lines in the diff to master
131142
deps = pylint

0 commit comments

Comments
 (0)