@@ -44,6 +44,9 @@ fake_ci_webhook:
4444test : .env
4545 docker-compose up --abort-on-container-exit --exit-code-from pact_verifier
4646 docker-compose logs pact_verifier
47+ test_native : .env
48+ docker-compose up --abort-on-container-exit --exit-code-from pact_verifier_native
49+ docker-compose logs pact_verifier_native
4750
4851# # =====================
4952# # Deploy tasks
@@ -108,6 +111,31 @@ test_pact_changed_webhook:
108111# # ======================
109112# # Misc
110113# # ======================
111-
114+ PROJECT := example-provider-python
115+ PYTHON_MAJOR_VERSION := 3.11
116+ sgr0 := $(shell tput sgr0)
117+ red := $(shell tput setaf 1)
118+ green := $(shell tput setaf 2)
112119.env :
113120 touch .env
121+
122+
123+ venv :
124+ @if [ -d " ./.venv" ]; then echo " $( red) .venv already exists, not continuing!$( sgr0) " ; exit 1; fi
125+ @type pyenv > /dev/null 2>&1 || (echo " $( red) pyenv not found$( sgr0) " ; exit 1)
126+
127+ @echo "\n$(green)Try to find the most recent minor version of the major version specified$(sgr0)"
128+ $(eval PYENV_VERSION=$(shell pyenv install -l | grep "\s\s$(PYTHON_MAJOR_VERSION)\.*" | tail -1 | xargs))
129+ @echo "$(PYTHON_MAJOR_VERSION) -> $(PYENV_VERSION)"
130+
131+ @echo "\n$(green)Install the Python pyenv version if not already available$(sgr0)"
132+ pyenv install $(PYENV_VERSION) -s
133+
134+ @echo "\n$(green)Make a .venv dir$(sgr0)"
135+ ~/.pyenv/versions/${PYENV_VERSION}/bin/python3 -m venv ${CURDIR}/.venv
136+
137+ @echo "\n$(green)Make it 'available' to pyenv$(sgr0)"
138+ ln -sf ${CURDIR}/.venv ~/.pyenv/versions/${PROJECT}
139+
140+ @echo "\n$(green)Use it! (populate .python-version)$(sgr0)"
141+ pyenv local ${PROJECT}
0 commit comments