commit 368fd4ed6390bdecbd9eac09c6d7bd5d573e7cbc
parent 95abb4f72a60b71fb1e44287c8aa9b1293bf4562
Author: ccx <ccx@te2000.cz>
Date: Mon, 26 Feb 2024 01:47:14 +0000
Use pip-tools from virutalenv instead of outside
Diffstat:
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/python.mk b/python.mk
@@ -8,6 +8,7 @@ PY_SRC:=$(wildcard *.py)
PY_REQ:=py-$(PYTHON_IMPL)-requirements.txt
PY_WHL:=work/wheels/$(PYTHON_IMPL)
VENV:=work/virtualenvs/$(PYTHON_IMPL)
+PYTHON_VENV_INSTALL=pip-tools wheel
pycodestyle: $(patsubst %.py,.%.pyfmt,$(PY_SRC)) $(VENV)/.done
'$(VENV)/bin/pylama' -l 88 $(PY_SRC) || true
@@ -20,10 +21,6 @@ pycodestyle: $(patsubst %.py,.%.pyfmt,$(PY_SRC)) $(VENV)/.done
if cmp -s '$<.tmp2' '$<'; then rm -v '$<.tmp2'; else mv -v '$<.tmp2' '$<'; fi
touch $@
-.PHONY: py-genpkg
-py-genpkg: $(VENV)/.done
- '$(VENV)/bin/python' genpkg.py
-
py-requirements: $(PY_REQ)
py-wheels: $(PY_WHL)/.done
@@ -35,20 +32,20 @@ py-virtualenv: py-venv
# -- requirement file rules
-$(PY_REQ): py-requirements.in
- '$(PYTHON_EXE)' -m piptools compile -v --annotate -o '$@.new' py-requirements.in
+$(PY_REQ): py-requirements.in $(VENV)/bin/pip-compile
+ '$(VENV)/bin/pip-compile' -v --annotate -o '$@.new' py-requirements.in
mv '$@.new' '$@'
# -- wheel building rules
$(PY_WHL)/.done: $(PY_REQ)
mkdir -p '$(PY_WHL)'
- '$(PYTHON_EXE)' -m pip wheel -w '$(PY_WHL)' -r '$(PY_REQ)'
+ '$(VENV)/bin/python' -m pip wheel -w '$(PY_WHL)' -r '$(PY_REQ)'
touch '$@'
# -- virtualenv rules
-$(VENV)/bin/pip-sync:
+$(VENV)/bin/pip-compile $(VENV)/bin/pip-sync:
if test -e '$(VENV)'; then rm -r '$(VENV)'; else true; fi
mkdir -p virtualenvs
$(PYTHON_VENV) '$(VENV)'