Skip to content

Commit

Permalink
Use milc for config check, requirements fixes
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
Erovia authored and skullydazed committed Apr 8, 2020
1 parent c61f016 commit 724f20e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bin/qmk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))

# QMK CLI user config file
config_file = Path(Path.home() / '.config/qmk/qmk.ini')
# Setup the CLI
import milc # noqa


def _check_modules(requirements):
Expand All @@ -24,7 +24,7 @@ def _check_modules(requirements):
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')

if line[0] == '#':
if len(line) == 0 or line[0] == '#' or '-r' in line:
continue

if '#' in line:
Expand Down Expand Up @@ -53,12 +53,10 @@ developer = False
_check_modules('requirements.txt')

# For developers additional modules are needed
if config_file.exists() and 'developer = True' in config_file.read_text():
if milc.cli.config.user.developer:
developer = True
_check_modules('requirements-dev.txt')

# Setup the CLI
import milc # noqa

milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'

Expand Down
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Install the necessary requirements
-r requirements.txt

# Python development requirements
nose2
flake8
pep8-naming
yapf

0 comments on commit 724f20e

Please sign in to comment.