From: Alexander Barton Date: Sat, 29 Jul 2023 16:33:45 +0000 (+0200) Subject: Makefile.boilerplate: Let Python "venv targets" depend on "requirements.txt" X-Git-Tag: rel-1-0-0~3 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ansible-collection-boilerplate.git;a=commitdiff_plain;h=d56b65f156bb19a9e76f2a5b3de9e6a97e65db65 Makefile.boilerplate: Let Python "venv targets" depend on "requirements.txt" This allows dependent projects to actually provide a Makefile target to generate the "requirements.txt" from an other package manager. With this change, both the "this_makefile_path" and "this_dir" variables are no longer used (never have been?) and therefore have been removed. --- diff --git a/Makefile.boilerplate b/Makefile.boilerplate index d469705..2342c2b 100644 --- a/Makefile.boilerplate +++ b/Makefile.boilerplate @@ -7,9 +7,6 @@ SOURCE_ROOT ?= $(CURDIR) VENV_D = $(SOURCE_ROOT)/.venv VENV_BIN = $(VENV_D)/bin -this_makefile_path:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -this_dir:=$(shell cd $(dir $(this_makefile_path));pwd) - check-ansible: $(VENV_BIN)/ansible-lint # Check Ansible executable ... "$(VENV_BIN)"/ansible --version @@ -37,12 +34,12 @@ distclean-ansible: test -h "$$cmd" && rm -f "$$cmd" || true; \ done -$(VENV_BIN)/ansible $(VENV_BIN)/ansible-galaxy $(VENV_BIN)/ansible-lint venv: $(VENV_BIN)/pip +$(VENV_BIN)/ansible $(VENV_BIN)/ansible-galaxy $(VENV_BIN)/ansible-lint venv: $(SOURCE_ROOT)/requirements.txt $(VENV_BIN)/pip # Install/upgrade Python package manager "$(VENV_BIN)"/pip install --upgrade pip wheel touch "$(VENV_BIN)/pip" "$(VENV_BIN)/wheel" # Install/upgrade Python dependencies ... - "$(VENV_BIN)"/pip install --upgrade --requirement $(this_dir)/requirements.txt + "$(VENV_BIN)"/pip install --upgrade --requirement $(SOURCE_ROOT)/requirements.txt touch "$(VENV_BIN)/ansible" "$(VENV_BIN)/ansible-galaxy" "$(VENV_BIN)/ansible-lint" $(VENV_BIN)/pip: