aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErovia <erovia@users.noreply.github.com>2020-02-20 01:10:56 +0100
committerskullydazed <skullydazed@users.noreply.github.com>2020-04-08 09:31:14 -0700
commit724f20ed32758b0c5d91ad4b7ba4a9348e152eeb (patch)
tree593ede983bd5a5b0a2e70afe63594dc6f87ede8c
parentc61f016fa491502920941fd03cdab6453d126e67 (diff)
downloadqmk_firmware-724f20ed32758b0c5d91ad4b7ba4a9348e152eeb.tar.gz
qmk_firmware-724f20ed32758b0c5d91ad4b7ba4a9348e152eeb.zip
Use milc for config check, requirements fixes
Use milc's config finding and parsing to check if the user is a developer or not. 'requirements-dev.txt' will now load 'requirements.txt', so no need to run pip twice. Add missing 'yapf' dependency to 'requirements-dev.txt'.
-rwxr-xr-xbin/qmk10
-rw-r--r--requirements-dev.txt4
2 files changed, 8 insertions, 6 deletions
diff --git a/bin/qmk b/bin/qmk
index e4fb057ff..b83f111e5 100755
--- a/bin/qmk
+++ b/bin/qmk
@@ -13,8 +13,8 @@ qmk_dir = script_dir.parent
13python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve() 13python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
14sys.path.append(str(python_lib_dir)) 14sys.path.append(str(python_lib_dir))
15 15
16# QMK CLI user config file 16# Setup the CLI
17config_file = Path(Path.home() / '.config/qmk/qmk.ini') 17import milc # noqa
18 18
19 19
20def _check_modules(requirements): 20def _check_modules(requirements):
@@ -24,7 +24,7 @@ def _check_modules(requirements):
24 for line in fd.readlines(): 24 for line in fd.readlines():
25 line = line.strip().replace('<', '=').replace('>', '=') 25 line = line.strip().replace('<', '=').replace('>', '=')
26 26
27 if line[0] == '#': 27 if len(line) == 0 or line[0] == '#' or '-r' in line:
28 continue 28 continue
29 29
30 if '#' in line: 30 if '#' in line:
@@ -53,12 +53,10 @@ developer = False
53_check_modules('requirements.txt') 53_check_modules('requirements.txt')
54 54
55# For developers additional modules are needed 55# For developers additional modules are needed
56if config_file.exists() and 'developer = True' in config_file.read_text(): 56if milc.cli.config.user.developer:
57 developer = True 57 developer = True
58 _check_modules('requirements-dev.txt') 58 _check_modules('requirements-dev.txt')
59 59
60# Setup the CLI
61import milc # noqa
62 60
63milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}' 61milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
64 62
diff --git a/requirements-dev.txt b/requirements-dev.txt
index deab419cb..1db3b6d73 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,4 +1,8 @@
1# Install the necessary requirements
2-r requirements.txt
3
1# Python development requirements 4# Python development requirements
2nose2 5nose2
3flake8 6flake8
4pep8-naming 7pep8-naming
8yapf