Skip to content

Commit fae4837

Browse files
committed
fixup! docs: Add make rule to prepare venv similar to RTD build environment
1 parent c68f4d3 commit fae4837

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/Makefile

+9-8
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@ BUILDDIR = build
88
all: clean html
99

1010
help:
11-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11+
@source venv/bin/activate && \
12+
$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1213
livehtml:
13-
@$(SPHINXAUTOBUILD) --watch ../repos --watch ../commands "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(0)
14+
@source venv/bin/activate && \
15+
$(SPHINXAUTOBUILD) --watch ../repos --watch ../commands "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(0)
1416

1517
# Prepare virtualenv similar to the environment used during build on Read The Docs and install required packages
1618
env:
17-
PY_VER=$$(sed -n -e 's/^\s*python:\s"\(.*\)"/\1/p' ../.readthedocs.yaml); \
18-
echo $$PY_VER; \
19+
@PY_VER=$$(sed -n -e 's/^\s*python:\s"\(.*\)"/\1/p' ../.readthedocs.yaml); \
1920
rm -fr ./venv; \
20-
virtualenv venv --python=python$$PY_VER; \
21-
source venv/bin/activate; \
21+
virtualenv venv --python=python$$PY_VER && \
22+
source venv/bin/activate && \
2223
pip install -r requirements-docs.txt;
2324

2425
# Catch-all target: route all unknown targets to Sphinx using the new
2526
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2627
%: Makefile
27-
echo $@
28-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
28+
@source venv/bin/activate && \
29+
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2930

3031
.PHONY: all help Makefile env

0 commit comments

Comments
 (0)