From 96ef2e81a706370f0702fe0b2cb0dcd4b3260817 Mon Sep 17 00:00:00 2001 From: Matej Matuska Date: Wed, 11 Sep 2024 08:36:06 +0200 Subject: [PATCH] fixup! docs: Add make rule to prepare venv similar to RTD build environment --- docs/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 7776471da8..54f790ee6c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,23 +8,24 @@ BUILDDIR = build all: clean html help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @source venv/bin/activate && \ + $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) livehtml: - @$(SPHINXAUTOBUILD) --watch ../repos --watch ../commands "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(0) + @source venv/bin/activate && \ + $(SPHINXAUTOBUILD) --watch ../repos --watch ../commands "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(0) # Prepare virtualenv similar to the environment used during build on Read The Docs and install required packages env: - PY_VER=$$(sed -n -e 's/^\s*python:\s"\(.*\)"/\1/p' ../.readthedocs.yaml); \ - echo $$PY_VER; \ + @PY_VER=$$(sed -n -e 's/^\s*python:\s"\(.*\)"/\1/p' ../.readthedocs.yaml); \ rm -fr ./venv; \ - virtualenv venv --python=python$$PY_VER; \ - source venv/bin/activate; \ + virtualenv venv --python=python$$PY_VER && \ + source venv/bin/activate && \ pip install -r requirements-docs.txt; # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - echo $@ - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @source venv/bin/activate && \ + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: all help Makefile env