Skip to content

Commit f21ec5d

Browse files
committed
Simplify the requirements setup further
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent b08c1bb commit f21ec5d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Doc/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ PAPER =
1414
SOURCES =
1515
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
1616
IS_PYTHON_BUILD = $(shell $(PYTHON) -c 'import sysconfig; print("true") if sysconfig.is_python_build() else None')
17-
REQUIREMENTS = requirements.txt
18-
REQUIREMENTS_NO_BUILD = requirements-no-build.txt
17+
REQUIREMENTS = $(if $(IS_PYTHON_BUILD),requirements.txt,requirements-no-build.txt)
1918
SPHINXERRORHANDLING = --fail-on-warning
2019

2120
# Internal variables.
@@ -168,19 +167,18 @@ clean-venv:
168167

169168
.PHONY: venv
170169
venv:
171-
requirements = -r $(REQUIREMENTS) $(if $(IS_PYTHON_BUILD),,-r $(REQUIREMENTS_NO_BUILD))
172170
@if [ -d $(VENVDIR) ] ; then \
173171
echo "venv already exists."; \
174172
echo "To recreate it, remove it first with \`make clean-venv'."; \
175173
else \
176174
echo "Creating venv in $(VENVDIR)"; \
177175
if $(UV) --version >/dev/null 2>&1; then \
178176
$(UV) venv --python=$(PYTHON) $(VENVDIR); \
179-
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install $(requirements); \
177+
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS); \
180178
else \
181179
$(PYTHON) -m venv $(VENVDIR); \
182180
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
183-
$(VENVDIR)/bin/python3 -m pip install $(requirements); \
181+
$(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
184182
fi; \
185183
echo "The venv has been created in the $(VENVDIR) directory"; \
186184
fi

Doc/requirements-no-build.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-r requirements.txt
2+
13
# Requirements when not running the build Python,
24
# such as optional native extensions.
35

0 commit comments

Comments
 (0)