summaryrefslogtreecommitdiff
path: root/bin/qmk
diff options
context:
space:
mode:
authorErovia <erovia@users.noreply.github.com>2020-03-23 17:08:35 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit9941734329547c7f2c4e0f94a04d54936e77eedb (patch)
tree4bc61bdd2f6051a4b2c411b2dea23da74b46853d /bin/qmk
parent874a6c9076bb89999f87f6285cd946adf6129a15 (diff)
Apply @skullydazed's suggestions, move 'import milc'
Only 'import milc' after we are sure that the minimum required modules are available, as it depends on a few of them.
Diffstat (limited to 'bin/qmk')
-rwxr-xr-xbin/qmk16
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/qmk b/bin/qmk
index 8225ba61cd..121aec4b3b 100755
--- a/bin/qmk
+++ b/bin/qmk
@@ -13,9 +13,6 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))
-# Setup the CLI
-import milc # noqa
-
def _check_modules(requirements):
""" Check if the modules in the given requirements.txt are available.
@@ -39,19 +36,20 @@ def _check_modules(requirements):
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.' % str(qmk_dir / requirements))
if developer:
- print('Please run `pip3 install -r requirements-dev.txt` to install the python development dependencies or turn off developer mode with `qmk config user.developer=None`.')
- print()
- else:
- print('Please run `pip3 install -r requirements.txt` to install the python dependencies.')
- print()
- exit(255)
+ 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:
developer = True