Add module definition file and Makefile itself to dependencies of Makefile updating Python Virtual Environments
requested to merge 318-virtual-environments-are-not-updated-when-module-definition-changes into main
Closes #318 (closed)
Makefile before:
PACKAGE_DIR ?= ..
MANIFEST_FILE ?= $(PACKAGE_DIR)/pyproject.toml
PYTHON_EXEC ?= /usr/bin/python3
VENV_DIR ?= .
VENV_ACTIVATE ?= $(VENV_DIR)/bin/activate
VENV_PYTHON_BIN ?= $(VENV_DIR)/bin/python3
VENV_PIP_BIN ?= $(VENV_DIR)/bin/pip3
all: $(VENV_ACTIVATE)
$(MANIFEST_FILE):
$(VENV_ACTIVATE): $(MANIFEST_FILE)
echo "Create virtual environment in $(VENV_DIR) ..."
"$(PYTHON_EXEC)" -m venv "$(VENV_DIR)"
echo "Upgrade pip ..."
"$(VENV_PIP_BIN)" install --upgrade pip
echo "Install package dependencies ..."
"$(VENV_PIP_BIN)" install -e "$(PACKAGE_DIR)"
Makefile after:
PACKAGE_DIR ?= ..
MANIFEST_FILE ?= $(PACKAGE_DIR)/pyproject.toml
MODULE_DEFINITION_FILE ?= /home/rkartmann/axii/data/modules/armarx/python3-armarx.json
MAKEFILE ?= Makefile
PYTHON_EXEC ?= /usr/bin/python3
VENV_DIR ?= .
VENV_ACTIVATE ?= $(VENV_DIR)/bin/activate
VENV_PYTHON_BIN ?= $(VENV_DIR)/bin/python3
VENV_PIP_BIN ?= $(VENV_DIR)/bin/pip3
all: $(VENV_ACTIVATE)
$(MANIFEST_FILE):
$(MODULE_DEFINITION_FILE):
$(MAKEFILE):
$(VENV_ACTIVATE): $(MANIFEST_FILE) $(MODULE_DEFINITION_FILE) $(MAKEFILE)
echo "Create virtual environment in $(VENV_DIR) ..."
"$(PYTHON_EXEC)" -m venv "$(VENV_DIR)"
echo "Upgrade pip ..."
"$(VENV_PIP_BIN)" install --upgrade pip
echo "Install package dependencies ..."
"$(VENV_PIP_BIN)" install -e "$(PACKAGE_DIR)"
Edited by Rainer Kartmann