Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 120ce557f1 | |||
| a15b0d6460 | |||
| f0dafaf068 | |||
| 3414bdcaa3 | |||
| c8567d8098 | |||
| dc3ca88deb | |||
| a4e9c34387 | |||
| 742e1ce0e1 | |||
| 39df759f57 | |||
| b694c4284d | |||
| e184710036 | |||
| d67addde2d | |||
| 29541559d0 | |||
| db0b8cb9a0 | |||
| 6a0e62a078 |
@@ -0,0 +1,68 @@
|
|||||||
|
name: CLI Setup
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test_cli_linux_macos:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
QMK_HOME: ~/qmk_firmware
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, ubuntu-latest]
|
||||||
|
python-version: [3.6, 3.7, 3.8]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install python dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install wheel
|
||||||
|
echo "::add-path::$HOME/.local/bin"
|
||||||
|
|
||||||
|
- name: Install QMK CLI from source
|
||||||
|
run: |
|
||||||
|
python3 -m pip install -r requirements.txt
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
cd ..
|
||||||
|
python3 -m pip install --force-reinstall --no-index --no-deps --prefix=~/.local --find-links qmk_cli/dist qmk
|
||||||
|
|
||||||
|
- name: Run qmk setup -y
|
||||||
|
run: qmk setup -y
|
||||||
|
|
||||||
|
test_cli_win:
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.6, 3.8]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: qmk/setup-msys2@v1
|
||||||
|
with:
|
||||||
|
update: true
|
||||||
|
|
||||||
|
- name: (MSYS2) Install git and python3
|
||||||
|
run: msys2do pacman -S git python3-pip --noconfirm
|
||||||
|
|
||||||
|
- name: (MSYS2) Upgrade pip and setuptools and install wheel
|
||||||
|
run: |
|
||||||
|
msys2do python3 -m pip install --upgrade pip setuptools
|
||||||
|
msys2do python3 -m pip install wheel
|
||||||
|
|
||||||
|
- name: (MSYS2) Install QMK CLI from source
|
||||||
|
run: msys2do ./setup_msys.sh $(cygpath "${{ github.workspace }}")
|
||||||
|
|
||||||
|
- name: (MSYS2) Run qmk setup -y
|
||||||
|
run: msys2do qmk setup -y
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# QMK CLI
|
# QMK CLI
|
||||||
|
[](https://github.com/qmk/qmk_cli/actions?query=workflow%3A%22CLI+Setup%22)
|
||||||
A program to help users work with [QMK Firmware](https://qmk.fm/).
|
A program to help users work with [QMK Firmware](https://qmk.fm/).
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
"""A program to help you work with qmk_firmware."""
|
"""A program to help you work with qmk_firmware."""
|
||||||
|
|
||||||
__version__ = '0.0.28'
|
__version__ = '0.0.31'
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
"""CLI wrapper for running QMK commands.
|
"""CLI wrapper for running QMK commands.
|
||||||
|
|
||||||
This program can be run from anywhere, with or without a qmk_firmware repository. If a qmk_firmware repository can be located we will use that to augment our available subcommands.
|
This program can be run from anywhere, with or without a qmk_firmware repository. If a qmk_firmware repository can be located we will use that to augment our available subcommands.
|
||||||
|
|
||||||
FIXME(skullydazed/anyone): --help shows underscores where we want dashes in subcommands (EG json_keymap instead of json-keymap)
|
|
||||||
TODO(skullydazed/anyone): Need a way to filter some subcommands from --help (EG `qmk hello`)
|
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
@@ -33,7 +30,7 @@ def in_qmk_firmware():
|
|||||||
while len(cur_dir.parents) > 0:
|
while len(cur_dir.parents) > 0:
|
||||||
found_bin = cur_dir / 'bin' / 'qmk'
|
found_bin = cur_dir / 'bin' / 'qmk'
|
||||||
if found_bin.is_file():
|
if found_bin.is_file():
|
||||||
command = [found_bin.as_posix(), '--version']
|
command = [sys.executable, found_bin.as_posix()]
|
||||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
@@ -67,6 +64,11 @@ def find_qmk_firmware():
|
|||||||
def main():
|
def main():
|
||||||
"""Setup the environment before dispatching to the entrypoint.
|
"""Setup the environment before dispatching to the entrypoint.
|
||||||
"""
|
"""
|
||||||
|
# Warn if they use an outdated python version
|
||||||
|
if sys.version_info < (3, 6):
|
||||||
|
print('Warning: Your Python version is out of date! Some subcommands may not work!')
|
||||||
|
print('Please upgrade to Python 3.6 or later.')
|
||||||
|
|
||||||
# Environment setup
|
# Environment setup
|
||||||
import qmk_cli
|
import qmk_cli
|
||||||
milc.cli.version = qmk_cli.__version__
|
milc.cli.version = qmk_cli.__version__
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def setup(cli):
|
|||||||
# Run `qmk_firmware/bin/qmk doctor` to check the rest of the environment out
|
# Run `qmk_firmware/bin/qmk doctor` to check the rest of the environment out
|
||||||
if qmk_firmware.exists():
|
if qmk_firmware.exists():
|
||||||
qmk_bin = qmk_firmware / 'bin' / 'qmk'
|
qmk_bin = qmk_firmware / 'bin' / 'qmk'
|
||||||
doctor = subprocess.run([sys.executable, qmk_bin, 'doctor'])
|
doctor = subprocess.run([sys.executable, str(qmk_bin), 'doctor'])
|
||||||
if doctor.returncode != 0:
|
if doctor.returncode != 0:
|
||||||
cli.log.error('Your build environment is not setup completely.')
|
cli.log.error('Your build environment is not setup completely.')
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.0.28
|
current_version = 0.0.31
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
tag_name = {new_version}
|
tag_name = {new_version}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ if __name__ == "__main__":
|
|||||||
"colorama",
|
"colorama",
|
||||||
"flake8",
|
"flake8",
|
||||||
"hjson",
|
"hjson",
|
||||||
|
"nose2",
|
||||||
"yapf"
|
"yapf"
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cp -r $1 ~/qmk_cli
|
||||||
|
|
||||||
|
export PATH=~/.local/bin:$PATH
|
||||||
|
echo "PATH=$PATH" >> ~/.bashrc
|
||||||
|
|
||||||
|
export QMK_HOME=~/qmk_firmware
|
||||||
|
export CLI_DIR=~/qmk_cli
|
||||||
|
|
||||||
|
cd $CLI_DIR
|
||||||
|
python3 -m pip install -r requirements.txt
|
||||||
|
python3 setup.py sdist bdist_wheel
|
||||||
|
cd ~
|
||||||
|
python3 -m pip install --force-reinstall --no-index --no-deps --prefix=~/.local --find-links qmk_cli/dist qmk
|
||||||
Reference in New Issue
Block a user