cache-dependency-path: 'Doc/requirements.txt'
- name: 'Install build dependencies'
run: make -C Doc/ venv
- - name: 'Check documentation'
- run: make -C Doc/ check
- name: 'Build HTML documentation'
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
# This build doesn't use problem matchers or check annotations
- # It also does not run 'make check', as sphinx-lint is not installed into the
- # environment.
build_doc_oldest_supported_sphinx:
name: 'Docs (Oldest Sphinx)'
runs-on: ubuntu-latest
- id: check-yaml
- id: trailing-whitespace
types_or: [c, python, rst]
+
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
+ rev: v0.6.7
+ hooks:
+ - id: sphinx-lint
+ args: [--enable=default-role]
+ files: ^Doc/
+ types: [rst]
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
.PHONY: check
-check:
- # Check the docs and NEWS files with sphinx-lint.
- # Ignore the tools and venv dirs and check that the default role is not used.
- $(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
- $(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
+check: venv
+ $(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
+ $(VENVDIR)/bin/python3 -m pre_commit run --all-files
.PHONY: serve
serve:
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
MarkupSafe<2.2
-
-# Direct dependencies of sphinx-lint
-polib<1.3
-regex<2024
blurb
-sphinx-lint==0.6.7
sphinxext-opengraph==0.7.5
# The theme used by the documentation is stored separately, so we need