8000 Working Python3 version checking. · pyscript/pyscript@7f104fd · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f104fd

Browse files
committed
Working Python3 version checking.
1 parent b22a96c commit 7f104fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
MIN_NODE_VER := 14
22
MIN_NPM_VER := 6
3-
MIN_PY_VER := 3.8
3+
MIN_PY3_VER := 8
44
NODE_VER := $(shell node -v | cut -d. -f1 | sed 's/^v\(.*\)/\1/')
55
NPM_VER := $(shell npm -v | cut -d. -f1)
6-
PY_VER := $(shell python -c "import sys;print(sys.version.split()[0])")
7-
PY_OK := $(shell python -c "from packaging import version;print(int(version.parse('$(PY_VER)') >= version.parse('$(MIN_PY_VER)')))")
6+
PY3_VER := $(shell python3 -c "import sys;t='{v[1]}'.format(v=list(sys.version_info[:2]));print(t)")
7+
PY_OK := $(shell python3 -c "print(int($(PY3_VER) >= $(MIN_PY3_VER)))")
88

99
all:
1010
@echo "\nThere is no default Makefile target right now. Try:\n"
@@ -33,7 +33,7 @@ check-npm:
3333
.PHONY: check-python
3434
check-python:
3535
@if [ $(PY_OK) -eq 0 ]; then \
36-
echo "\033[0;31mRequires Python $(MIN_PY_VER).x or higher: $(PY_VER) detected.\033[0m"; \
36+
echo "\033[0;31mRequires Python 3.$(MIN_PY3_VER).x or higher: 3.$(PY3_VER) detected.\033[0m"; \
3737
false; \
3838
fi
3939

0 commit comments

Comments
 (0)
0