.PHONY: setup test demo lint
PY ?= .venv/bin/python
setup:  ## venv + tools + docker collection (needed once before test/demo/lint)
	python3 -m venv .venv && .venv/bin/pip install -q ansible-core ansible-lint pre-commit yamllint pytest jinja2 pyyaml docker
	.venv/bin/ansible-galaxy collection install -r requirements.yml
.venv/bin/python:
	@echo "No .venv found - run 'make setup' first" >&2; exit 1
test: $(PY)
	PATH=$(PWD)/.venv/bin:$$PATH $(PY) -m pytest -q tests
demo: $(PY)
	PATH=$(PWD)/.venv/bin:$$PATH demo/run_demo.sh
lint:
	PATH=$(PWD)/.venv/bin:$$PATH .venv/bin/pre-commit run --all-files
