2019-09-22 22:25:33 +02:00
|
|
|
"""QMK CLI Subcommands
|
|
|
|
|
|
|
|
We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
|
|
|
|
"""
|
2020-04-18 22:00:56 +02:00
|
|
|
import sys
|
|
|
|
|
2021-04-15 04:00:22 +02:00
|
|
|
from milc import cli, __VERSION__
|
2020-03-13 23:47:04 +01:00
|
|
|
|
2020-10-07 02:10:19 +02:00
|
|
|
from . import c2json
|
2019-09-22 22:25:33 +02:00
|
|
|
from . import cformat
|
2020-11-28 21:02:18 +01:00
|
|
|
from . import chibios
|
2020-11-04 20:18:47 +01:00
|
|
|
from . import clean
|
2019-09-22 22:25:33 +02:00
|
|
|
from . import compile
|
|
|
|
from . import config
|
2021-05-09 05:56:07 +02:00
|
|
|
from . import console
|
2019-10-08 20:06:26 +02:00
|
|
|
from . import docs
|
2019-09-22 22:25:33 +02:00
|
|
|
from . import doctor
|
2020-12-10 18:01:51 +01:00
|
|
|
from . import fileformat
|
2019-10-05 08:38:34 +02:00
|
|
|
from . import flash
|
2021-03-25 12:38:10 +01:00
|
|
|
from . import format
|
2020-10-25 22:48:44 +01:00
|
|
|
from . import generate
|
2019-09-22 22:25:33 +02:00
|
|
|
from . import hello
|
2020-05-26 22:05:41 +02:00
|
|
|
from . import info
|
2020-03-10 21:51:19 +01:00
|
|
|
from . import json2c
|
2020-11-07 18:56:08 +01:00
|
|
|
from . import lint
|
2019-10-07 20:32:30 +02:00
|
|
|
from . import list
|
2019-11-13 05:55:41 +01:00
|
|
|
from . import kle2json
|
2021-05-09 17:06:44 +02:00
|
|
|
from . import multibuild
|
2019-09-22 22:25:33 +02:00
|
|
|
from . import new
|
|
|
|
from . import pyformat
|
|
|
|
from . import pytest
|
2020-03-13 23:47:04 +01:00
|
|
|
|
2021-02-13 19:26:45 +01:00
|
|
|
# Supported version information
|
|
|
|
#
|
|
|
|
# Based on the OSes we support these are the minimum python version available by default.
|
|
|
|
# Last update: 2021 Jan 02
|
|
|
|
#
|
|
|
|
# Arch: 3.9
|
|
|
|
# Debian: 3.7
|
|
|
|
# Fedora 31: 3.7
|
|
|
|
# Fedora 32: 3.8
|
|
|
|
# Fedora 33: 3.9
|
|
|
|
# FreeBSD: 3.7
|
|
|
|
# Gentoo: 3.7
|
|
|
|
# macOS: 3.9 (from homebrew)
|
|
|
|
# msys2: 3.8
|
|
|
|
# Slackware: 3.7
|
|
|
|
# solus: 3.7
|
|
|
|
# void: 3.9
|
|
|
|
|
|
|
|
if sys.version_info[0] != 3 or sys.version_info[1] < 7:
|
2021-04-15 04:00:22 +02:00
|
|
|
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)}')
|
2020-04-18 22:00:56 +02:00
|
|
|
exit(127)
|