From 4fa814a56e3dea48387a964d9368f66df1d9dbb8 Mon Sep 17 00:00:00 2001 From: Hal Wine Date: Fri, 25 Sep 2020 17:03:23 -0700 Subject: [PATCH] Python version test now correct --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 265b3f2..a46cec6 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +SHELL := bash -o pipefail TODAY := $(shell date '+%Y-%m-%d') @@ -7,7 +8,10 @@ AWS_PROFILE := default PYTEST_OPTS := '' +# Prepare for python version checks PYTHON_MIN_VERSION := 3.8 +PYTHON_CUR_VERSION := $(shell python3 -V 2>/dev/null) +PYTHON_GOOD := $(shell echo $(PYTHON_CUR_VERSION) | grep --silent $(PYTHON_MIN_VERSION) && echo true || echo false ) PYTHON_VER_WARNING = $(warning Warning! Frost supports Python $(PYTHON_MIN_VERSION), \ you're running $(shell python3 -V)) PYTHON_VER_ERROR = $(error Frost supports Python $(PYTHON_MIN_VERSION), \ @@ -24,8 +28,10 @@ awsci: check_venv check_venv: ifeq ($(VIRTUAL_ENV),) $(error "Run frost from a virtualenv (try 'make install && source venv/bin/activate')") +else ifneq ($(PYTHON_GOOD),true) + $(PYTHON_VER_WARNING) else - python3 -V | grep $(PYTHON_MIN_VERSION) || true ; $(PYTHON_VER_WARNING) + @echo "Using $(PYTHON_CUR_VERSION)" endif check_conftest_imports: