gmake_python_helpers

Helpers for using Python venv/pip-tools/black/pylama/... with GNU make
git clone https://ccx.te2000.cz/git/gmake_python_helpers
Log | Files | Refs | README

commit 220b89a088306e533b8d7c917b9b90bc8d8f86c6
parent 12112aeed100e59376ccccd452a0339197267165
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Wed, 25 Jun 2025 02:05:35 +0000

Add aggregated targets for venvs, wheels and requirements.txt files

Diffstat:
Mpip-tools.mk | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pip-tools.mk b/pip-tools.mk @@ -3,6 +3,12 @@ include gmake_python_helpers/python-vars.mk venv_base?=virtualenvs venv_pip:=$(venv_base)/pip-tools-$(PYTHON_IMPL) +# -- aggregated targets: + +py-requirements: $(python_requirements_targets) # updates all *-requirements.txt files +py-wheels: $(python_wheel_targets) # builds wheels for all environments +venv: $(python_venv_targets) # installs/updates and symlinks all virtual environments + # -- requirement file rule generator ### example use: @@ -18,14 +24,19 @@ $(1)-$(PYTHON_IMPL)-requirements.txt: $(2) $(PIP_COMPILE_DEP) .PRECIOUS: $(1)-$(PYTHON_IMPL)-requirements.txt +python_requirements_targets+=$(1)-$(PYTHON_IMPL)-requirements.txt +python_wheel_targets+=wheels/$(PYTHON_IMPL)/.done-$(1) + venv_$(1):=$(venv_base)/$(1)-$(PYTHON_IMPL) venv-$(1): $(venv_base)/$(1)-$(PYTHON_IMPL)/.done ln -sf '$$(venv_base)/$(1)-$(PYTHON_IMPL)' venv-$(1) .PHONY: venv-$(1) +python_venv_targets+=venv-$(1) endef -# The pip-tools venv is not like the others +# The pip-tools venv is not like the others. +# It's created for internal use when there's no available install of pip-tools already. venv-pip-tools: $(venv_pip)/bin/pip-compile $(venv_pip)/bin/wheel ln -sf '$(venv_pip)' venv-pip-tools