Skip to content

Commit

Permalink
docs: Add make rule to prepare venv similar to RTD build env
Browse files Browse the repository at this point in the history
  • Loading branch information
matejmatuska committed Sep 10, 2024
1 parent a93e250 commit 318761b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ help:
livehtml:
@$(SPHINXAUTOBUILD) --watch ../leapp "$(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 doesn't really work with relative paths :), so keeping it in the project root
pushd .. && pip install -r requirements-docs.txt; popd

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: all help Makefile
.PHONY: all help Makefile env

0 comments on commit 318761b

Please sign in to comment.