Skip to content

Commit 9cb3ba4

Browse files
committed
Reuse existing venv target for PDF venv creation
1 parent 83e4b7e commit 9cb3ba4

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

Doc/Makefile

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,9 @@ venv:
187187

188188
.PHONY: venv-pdf
189189
venv-pdf:
190-
@if [ -d $(VENVDIR_PDF) ] ; then \
191-
echo "venv-pdf already exists."; \
192-
echo "To recreate it, remove it first with \`make clean-venv'."; \
193-
else \
194-
set -e; \
195-
echo "Creating venv in $(VENVDIR_PDF)"; \
196-
if $(UV) --version >/dev/null 2>&1; then \
197-
$(UV) venv --python=$(PYTHON) $(VENVDIR_PDF); \
198-
VIRTUAL_ENV=$(VENVDIR_PDF) $(UV) pip install -r requirements-pdf.txt; \
199-
else \
200-
$(PYTHON) -m venv $(VENVDIR_PDF); \
201-
$(VENVDIR_PDF)/bin/python3 -m pip install --upgrade pip; \
202-
$(VENVDIR_PDF)/bin/python3 -m pip install -r requirements-pdf.txt; \
203-
fi; \
204-
echo "The venv has been created in the $(VENVDIR_PDF) directory"; \
205-
fi
190+
venv-pdf: REQUIREMENTS = requirements-pdf.txt
191+
venv-pdf: VENVDIR = $(VENVDIR_PDF)
192+
venv-pdf: venv
206193

207194
.PHONY: dist-no-html
208195
dist-no-html: dist-text dist-epub dist-texinfo
@@ -251,7 +238,7 @@ dist-text:
251238
@echo "Build finished and archived!"
252239

253240
.PHONY: dist-pdf
254-
dist-pdf: venv-pdf
241+
dist-pdf:
255242
# archive the A4 latex
256243
@echo "Building LaTeX (A4 paper)..."
257244
mkdir -p dist

0 commit comments

Comments
 (0)