From 42a1061bfa077ff9dffb088746ee3644caf6d44a Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Tue, 13 Jul 2021 15:45:23 -0700 Subject: [PATCH] fix: small fixes for Makefile (#15670) --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a51b96fdb2..5de06f057b 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,9 @@ # limitations under the License. # +# Python version installed; we need 3.8 or 3.7 +PYTHON=`command -v python3.8 || command -v python3.7` + .PHONY: install superset venv pre-commit install: superset pre-commit @@ -59,8 +62,9 @@ update-js: venv: # Create a virtual environment and activate it (recommended) - python3 -m venv venv # setup a python3 virtualenv - source venv/bin/activate + if ! [ -x "${PYTHON}" ]; then echo "You need Python 3.7 or 3.8 installed"; exit 1; fi + test -d venv || ${PYTHON} -m venv venv # setup a python3 virtualenv + . venv/bin/activate pre-commit: # setup pre commit dependencies