diff --git a/docs/Makefile b/docs/Makefile index 282c97a98b..7776471da8 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,10 +12,19 @@ help: livehtml: @$(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; \ + rm -fr ./venv; \ + 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) -.PHONY: all help Makefile +.PHONY: all help Makefile env