diff options
author | QMK Bot <hello@qmk.fm> | 2021-04-15 02:00:59 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-04-15 02:00:59 +0000 |
commit | 2c0aa27e6c0db68c026d2e8d1b416bac5e9599a5 (patch) | |
tree | 8b0bb8f960c3edb631e30d391eb69443c85c48c2 /lib/python/qmk/cli/__init__.py | |
parent | 19b143688fabcad7ffd192e56642232f1a08fdae (diff) | |
parent | 588bcdc8ca212b195a428fc43766a59a9252c08d (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/cli/__init__.py')
-rw-r--r-- | lib/python/qmk/cli/__init__.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 1349e68a9b..f7df908119 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -4,7 +4,7 @@ We list each subcommand here explicitly because all the reliable ways of searchi """ import sys -from milc import cli +from milc import cli, __VERSION__ from . import c2json from . import cformat @@ -47,5 +47,15 @@ from . import pytest # void: 3.9 if sys.version_info[0] != 3 or sys.version_info[1] < 7: - cli.log.error('Your Python is too old! Please upgrade to Python 3.7 or later.') + print('Error: Your Python is too old! Please upgrade to Python 3.7 or later.') + exit(127) + +milc_version = __VERSION__.split('.') + +if int(milc_version[0]) < 2 and int(milc_version[1]) < 3: + from pathlib import Path + + requirements = Path('requirements.txt').resolve() + + print(f'Your MILC library is too old! Please upgrade: python3 -m pip install -U -r {str(requirements)}') exit(127) |