summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-05-10 12:16:04 -0700
committerZach White <skullydazed@gmail.com>2021-05-10 12:16:04 -0700
commit0e7c66e8917ee470d8a3d3904bd8b55c75c8a0b4 (patch)
treee53a16e0631ac22b68a66bd219d0ff3c107b36ee /bin
parent911b45ce3bcc2cf4c7e12ccf8df7da9621173e32 (diff)
parentbc38c38f8c25dcbe759bc4d9d707a0069b3c6c59 (diff)
downloadqmk_firmware-0e7c66e8917ee470d8a3d3904bd8b55c75c8a0b4.tar.gz
qmk_firmware-0e7c66e8917ee470d8a3d3904bd8b55c75c8a0b4.zip
Merge remote-tracking branch 'origin/master' into develop
Conflicts: bin/qmk lib/python/qmk/cli/__init__.py Merge conflicts fixed by skullydazed.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/qmk46
1 files changed, 0 insertions, 46 deletions
diff --git a/bin/qmk b/bin/qmk
index 4b5fd5bbce..a6e8ce08da 100755
--- a/bin/qmk
+++ b/bin/qmk
@@ -3,7 +3,6 @@
"""
import os
import sys
-from importlib.util import find_spec
from pathlib import Path
# Add the QMK python libs to our path
@@ -12,54 +11,9 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))
-
-def _check_modules(requirements):
- """ Check if the modules in the given requirements.txt are available.
- """
- with Path(qmk_dir / requirements).open() as fd:
- for line in fd.readlines():
- line = line.strip().replace('<', '=').replace('>', '=')
-
- if len(line) == 0 or line[0] == '#' or line.startswith('-r'):
- continue
-
- if '#' in line:
- line = line.split('#')[0]
-
- module = dict()
- module['name'] = line.split('=')[0] if '=' in line else line
- module['import'] = module['name'].replace('-', '_')
-
- # Not every module is importable by its own name.
- if module['name'] == "pep8-naming":
- module['import'] = "pep8ext_naming"
- elif module['name'] == 'pyusb':
- module['import'] = 'usb.core'
-
- if not find_spec(module['import']):
- print('Could not find module %s!' % module['name'])
- print('Please run `python3 -m pip install -r %s` to install required python dependencies.' % (qmk_dir / requirements,))
- if developer:
- print('You can also turn off developer mode: qmk config user.developer=None')
- print()
- exit(255)
-
-
-developer = False
-# Make sure our modules have been setup
-_check_modules('requirements.txt')
-
# Setup the CLI
import milc # noqa
-# For developers additional modules are needed
-if milc.cli.config.user.developer:
- # Do not run the check for 'config',
- # so users can turn off developer mode
- if len(sys.argv) == 1 or (len(sys.argv) > 1 and 'config' != sys.argv[1]):
- developer = True
- _check_modules('requirements-dev.txt')
-
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'