Skip to content

Commit

Permalink
Python version test now correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Hal Wine committed Sep 26, 2020
1 parent bac09e3 commit 4fa814a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SHELL := bash -o pipefail

TODAY := $(shell date '+%Y-%m-%d')

Expand All @@ -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), \
Expand All @@ -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:
Expand Down

0 comments on commit 4fa814a

Please sign in to comment.