Skip to content

Commit

Permalink
docs: Add make rule to prepare venv similar to RTD build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
matejmatuska committed Sep 11, 2024
1 parent 8c49215 commit 4d13c58
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4d13c58

Please sign in to comment.