66# You can set these variables from the command line.
77PYTHON = python3
88VENVDIR = ./venv
9- VENVDIR_PDF = ./venv-pdf
109UV = uv
1110SPHINXBUILD = PATH=$(VENVDIR ) /bin:$$PATH sphinx-build
1211BLURB = PATH=$(VENVDIR ) /bin:$$PATH blurb
@@ -89,6 +88,7 @@ htmlhelp: build
8988 " build/htmlhelp/pydoc.hhp project file."
9089
9190.PHONY : latex
91+ latex : _ensure-sphinxcontrib-svg2pdfconverter
9292latex : BUILDER = latex
9393latex : build
9494 @echo " Build finished; the LaTeX files are in build/latex."
@@ -164,7 +164,7 @@ clean: clean-venv
164164
165165.PHONY : clean-venv
166166clean-venv :
167- rm -rf $(VENVDIR ) $( VENVDIR_PDF )
167+ rm -rf $(VENVDIR )
168168
169169.PHONY : venv
170170venv :
@@ -185,12 +185,6 @@ venv:
185185 echo " The venv has been created in the $( VENVDIR) directory" ; \
186186 fi
187187
188- .PHONY : venv-pdf
189- venv-pdf :
190- venv-pdf : REQUIREMENTS = requirements-pdf.txt
191- venv-pdf : VENVDIR = $(VENVDIR_PDF )
192- venv-pdf : venv
193-
194188.PHONY : dist-no-html
195189dist-no-html : dist-text dist-epub dist-texinfo
196190
@@ -238,13 +232,13 @@ dist-text:
238232 @echo " Build finished and archived!"
239233
240234.PHONY : dist-pdf
241- dist-pdf :
235+ dist-pdf : _ensure-sphinxcontrib-svg2pdfconverter
242236 # archive the A4 latex
243237 @echo " Building LaTeX (A4 paper)..."
244238 mkdir -p dist
245239 rm -rf build/latex
246240 find dist -name ' python-$(DISTVERSION)-docs-pdf*' -exec rm -rf {} \;
247- $(MAKE ) latex PAPER=a4 VENVDIR= $( VENVDIR_PDF )
241+ $(MAKE ) latex PAPER=a4
248242 # remove zip & bz2 dependency on all-pdf,
249243 # as otherwise the full latexmk process is run twice.
250244 # ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
@@ -299,6 +293,10 @@ _ensure-pre-commit:
299293_ensure-sphinx-autobuild :
300294 $(MAKE ) _ensure-package PACKAGE=sphinx-autobuild
301295
296+ .PHONY : _ensure-sphinxcontrib-svg2pdfconverter
297+ _ensure-sphinxcontrib-svg2pdfconverter :
298+ $(MAKE ) _ensure-package PACKAGE=sphinxcontrib-svg2pdfconverter
299+
302300.PHONY : check
303301check : _ensure-pre-commit
304302 $(VENVDIR ) /bin/python3 -m pre_commit run --all-files
0 commit comments