Skip to content

Commit b37efb4

Browse files
timlnxclaude
andcommitted
make docs: use bitmath2 Python 3.12 venv for doc builds
Adds docs-venv target that creates the venv on first run and installs doc-requirements.txt into it. The docs target activates it before invoking sphinx. Venv directory added to .gitignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 021b523 commit b37efb4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ docsite/build/html
5151
docsite/build/doctrees
5252
bitmathenv3
5353
bitmathenv2
54+
bitmath2

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ MANPAGES := bitmath.1
4545
######################################################################
4646

4747
# Documentation. YAY!!!!
48-
docs: conf.py $(MANPAGES) docsite/source/index.rst
49-
pip3 install -q -r doc-requirements.txt
50-
cd docsite; make html; cd -
48+
DOCSVENV := bitmath2
49+
50+
docs-venv:
51+
@if [ ! -d "$(DOCSVENV)" ]; then \
52+
echo "Creating docs virtualenv '$(DOCSVENV)' with Python 3.12..."; \
53+
python3.12 -m venv $(DOCSVENV); \
54+
fi
55+
. $(DOCSVENV)/bin/activate && pip install -q -r doc-requirements.txt
56+
57+
docs: docs-venv conf.py $(MANPAGES) docsite/source/index.rst
58+
. $(DOCSVENV)/bin/activate && cd docsite && make html
5159

5260
# Add examples to the RTD docs by taking it from the README
5361
docsite/source/index.rst: docsite/source/index.rst.in README.rst VERSION

0 commit comments

Comments
 (0)