build(docs): use the checkout tool environment when it exists

The documentation needs extensions that are not installed system-wide, so
make html failed on a fresh shell even though the project already keeps them in
the root tool environment. Falling back to sphinx-build keeps the target
working when no environment is present.
This commit is contained in:
BlackAngelTV committed 2026-11-11 19:38:09 +01:00
1 parent 598030025b
commit 49cbc34ff2
1 file changed
+5 -2
+5 -2
View File
@@ -16,9 +16,12 @@ override OPTS=
endif
# You can set these variables from the command line.
# Prefer the tool environment kept at the root of the checkout, so that the
# documentation builds without installing its extensions system-wide.
VENV ?= ../.venv
SPHINXOPTS = -n -q -j auto -T $(FAIL_WARN) $(OPTS)
SPHINXBUILD = sphinx-build
SPHINXAUTOBUILD = sphinx-autobuild
SPHINXBUILD ?= $(if $(wildcard $(VENV)/bin/sphinx-build),$(VENV)/bin/sphinx-build,sphinx-build)
SPHINXAUTOBUILD ?= $(if $(wildcard $(VENV)/bin/sphinx-autobuild),$(VENV)/bin/sphinx-autobuild,sphinx-autobuild)
SPHINXPROJ = kitty
SOURCEDIR = .
BUILDDIR = _build