Skip to content

Commit 05084a8

Browse files
committed
Fix when using the local Python
Signed-off-by: Filipe Laíns <[email protected]>
1 parent 7424cb3 commit 05084a8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Doc/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ JOBS = auto
1313
PAPER =
1414
SOURCES =
1515
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
16+
IS_PYTHON_BUILD = $(if $(shell $(PYTHON) -c 'import sys, sysconfig; sys.exit(sysconfig.is_python_build())'), true, false)
1617
REQUIREMENTS = requirements.txt
18+
REQUIREMENTS_NO_BUILD = requirements-no-build.txt
1719
SPHINXERRORHANDLING = --fail-on-warning
1820

1921
# Internal variables.
@@ -174,10 +176,16 @@ venv:
174176
if $(UV) --version >/dev/null 2>&1; then \
175177
$(UV) venv $(VENVDIR); \
176178
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS); \
179+
if ! $(IS_PYTHON_BUILD); then \
180+
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS_NO_BUILD); \
181+
fi; \
177182
else \
178183
$(PYTHON) -m venv $(VENVDIR); \
179184
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
180185
$(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
186+
if ! $(IS_PYTHON_BUILD); then \
187+
$(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS_NO_BUILD); \
188+
fi; \
181189
fi; \
182190
echo "The venv has been created in the $(VENVDIR) directory"; \
183191
fi

Doc/requirements-no-build.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Requirements when not running the build Python,
2+
# such as optional native extensions.
3+
4+
--only-binary
5+
6+
# Needed to support generating social cards in sphinxext-opengraph.
7+
matplotlib

Doc/requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@ sphinx-notfound-page~=1.0.0
1818
# to install that as well.
1919
python-docs-theme>=2023.3.1,!=2023.7
2020

21-
# Needed to support generating social cards in sphinxext-opengraph.
22-
matplotlib
23-
2421
-c constraints.txt

0 commit comments

Comments
 (0)