Skip to content

Commit 36d91c1

Browse files
fix: touch venv stamp file instead of venv dir (#25)
This prevents cache reloading issues which can result in creating a new file `.venv` instead of touching the dir `.venv`.
1 parent 2a7a05c commit 36d91c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VENV ?= .venv
2+
VENV_STAMP := $(VENV)/.stamp
23
PYTHON := $(VENV)/bin/python
34
PIP := $(VENV)/bin/pip
45
ANSIBLE_PLAYBOOK := $(VENV)/bin/ansible-playbook
@@ -47,9 +48,9 @@ $(TF_SUBDIR)/.terraform: $(TF_SUBDIR)/provider.tf
4748
@$(TF) -chdir=$(TF_SUBDIR) init
4849
touch $(TF_SUBDIR)/.terraform
4950

50-
venv: $(VENV)
51+
venv: $(VENV_STAMP)
5152

52-
$(VENV): $(PYTHON_REQS_FILE) $(ANSIBLE_REQS_FILE)
53+
$(VENV_STAMP): $(PYTHON_REQS_FILE) $(ANSIBLE_REQS_FILE)
5354
@python3 -m venv $(VENV)
5455
@$(PIP) install --upgrade pip
5556
@$(PIP) install -r $(PYTHON_REQS_FILE)
@@ -59,7 +60,7 @@ $(VENV): $(PYTHON_REQS_FILE) $(ANSIBLE_REQS_FILE)
5960
echo "Installing Ansible Galaxy collections..."; \
6061
$(GIT_SILENCE_DETACHED) $(ANSIBLE_GALAXY) collection install -r $(ANSIBLE_REQS_FILE); \
6162
fi
62-
touch $(VENV)
63+
touch $@
6364

6465
lint: venv init
6566
@echo "Running terraform fmt check..."

0 commit comments

Comments
 (0)