Skip to content

Commit

Permalink
Remove bin/qmk (qmk#14231)
Browse files Browse the repository at this point in the history
* Remove the bin/qmk script

* remove bin/qmk from workflows
  • Loading branch information
skullydazed committed Aug 29, 2021
1 parent b46064a commit 596c4a1
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 114 deletions.
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ keymap:
via:
- keyboards/**/keymaps/via/*
cli:
- bin/qmk
- requirements.txt
- lib/python/**/*
python:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
pull_request:
paths:
- 'lib/python/**'
- 'bin/qmk'
- 'requirements.txt'
- '.github/workflows/cli.yml'

Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ endif
endif

# Determine which qmk cli to use
ifeq (,$(shell which qmk))
QMK_BIN = bin/qmk
else
QMK_BIN = qmk
endif
QMK_BIN := qmk

# avoid 'Entering|Leaving directory' messages
MAKEFLAGS += --no-print-directory
Expand Down
58 changes: 0 additions & 58 deletions bin/qmk

This file was deleted.

2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ enum my_keycodes {

Before opening a pull request, you can preview your changes if you have set up the development environment by running this command from the `qmk_firmware/` folder:

./bin/qmk docs
qmk docs

or if you only have Python 3 installed:

Expand Down
19 changes: 0 additions & 19 deletions docs/de/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,6 @@ Wir suchen nach Freiwilligen, die ein `qmk`-Package für weitere Betriebssysteme
* Installiere mit einem [virtualenv](https://virtualenv.pypa.io/en/latest/).
* Weise den User an, die Umgebungs-Variable `QMK_HOME` zu setzen, um die Firmware-Quelle anders einzustellen als `~/qmk_firmware`.

# Lokale CLI

Wenn Du die globale CLI nicht verwenden möchtest, beinhaltet `qmk_firmware` auch eine lokale CLI. Du kannst sie hier finden: `qmk_firmware/bin/qmk`. Du kannst den `qmk`-Befehl aus irgendeinem Datei-Verzeichnis ausführen und es wird immer auf dieser Kopie von `qmk_firmware` arbeiten.

**Beispiel**:

```
$ ~/qmk_firmware/bin/qmk hello
Ψ Hello, World!
```

## Einschränkungen der lokalen CLI

Hier ein Vergleich mit der globalen CLI:

* Die lokale CLI unterstützt kein `qmk setup` oder `qmk clone`.
* Die lokale CLI arbeitet immer innerhalb der selben `qmk_firmware`-Verzeichnisstruktur, auch wenn Du mehrere Repositories geklont hast.
* Die lokale CLI läuft nicht in einer virtualenv. Daher ist es möglich, dass Abhängigkeiten (dependencies) miteinander in Konflikt kommen/stehen.

# CLI-Befehle

## `qmk compile`
Expand Down
19 changes: 0 additions & 19 deletions docs/fr-fr/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,6 @@ Nous recherchons des gens pour créer et maintenir un paquet `qmk` pour plus de
* Installez en utilisant un virtualenv
* Expliquez à l'utilisateur de définir la variable d'environnement `QMK_Home` pour "check out" les sources du firmware à un autre endroit que `~/qmk_firmware`.

# CLI locale

Si vous ne voulez pas utiliser la CLI globale, il y a une CLI locale empaquetée avec `qmk_firmware`. Vous pouvez le trouver dans `qmk_firmware/bin/qmk`. Vous pouvez lancer la commande `qmk` depuis n'importe quel répertoire et elle fonctionnera toujours sur cette copie de `qmk_firmware`.

**Exemple**:

```
$ ~/qmk_firmware/bin/qmk hello
Ψ Hello, World!
```

## Limitations de la CLI locale

Il y a quelques limitations à la CLI locale comparé à la globale:

* La CLI locale ne supporte pas `qmk setup` ou `qmk clone`
* La CLI locale n'opère pas sur le même arbre `qmk_firmware`, même si vous avez plusieurs dépôts clonés.
* La CLI locale ne s'exécute pas dans un virtualenv, donc il y a des risques que des dépendances seront en conflit

# Les commandes CLI

## `qmk compile`
Expand Down
4 changes: 2 additions & 2 deletions keyboards/dztech/dz65rgb/keymaps/jumper149/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Run commands in the root directory of this repository.

```
./bin/qmk compile && sudo dfu-programmer atmega32u4 erase && sudo dfu-programmer atmega32u4 flash ./dztech_dz65rgb_v2_jumper149.hex && sudo dfu-programmer atmega32u4 reset
qmk compile && sudo dfu-programmer atmega32u4 erase && sudo dfu-programmer atmega32u4 flash ./dztech_dz65rgb_v2_jumper149.hex && sudo dfu-programmer atmega32u4 reset
```

## build

```
./bin/qmk compile
qmk compile
```

## flash
Expand Down
1 change: 0 additions & 1 deletion lib/python/qmk/cli/doctor/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class CheckStatus(Enum):
'arm-none-eabi-gcc': {
'version_arg': '-dumpversion'
},
'bin/qmk': {},
}


Expand Down
6 changes: 3 additions & 3 deletions lib/python/qmk/cli/format/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def format_python(cli):
"""Format python code according to QMK's style.
"""
edit = '--diff' if cli.args.dry_run else '--in-place'
yapf_cmd = ['yapf', '-vv', '--recursive', edit, 'bin/qmk', 'lib/python']
yapf_cmd = ['yapf', '-vv', '--recursive', edit, 'lib/python']
try:
cli.run(yapf_cmd, check=True, capture_output=False, stdin=DEVNULL)
cli.log.info('Python code in `bin/qmk` and `lib/python` is correctly formatted.')
cli.log.info('Python code in `lib/python` is correctly formatted.')
return True

except CalledProcessError:
if cli.args.dry_run:
cli.log.error('Python code in `bin/qmk` and `lib/python` incorrectly formatted!')
cli.log.error('Python code in `lib/python` is incorrectly formatted!')
else:
cli.log.error('Error formatting python code!')

Expand Down
2 changes: 1 addition & 1 deletion lib/python/qmk/cli/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def pytest(cli):
"""Run several linting/testing commands.
"""
nose2 = cli.run(['nose2', '-v'], capture_output=False, stdin=DEVNULL)
flake8 = cli.run(['flake8', 'lib/python', 'bin/qmk'], capture_output=False, stdin=DEVNULL)
flake8 = cli.run(['flake8', 'lib/python'], capture_output=False, stdin=DEVNULL)

return flake8.returncode | nose2.returncode
2 changes: 1 addition & 1 deletion lib/python/qmk/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def compile_configurator_json(user_keymap, bootloader=None, parallel=1, **env_va
f'VERBOSE={verbose}',
f'COLOR={color}',
'SILENT=false',
f'QMK_BIN={"bin/qmk" if "DEPRECATED_BIN_QMK" in os.environ else "qmk"}',
'QMK_BIN="qmk"',
])

return make_command
Expand Down
2 changes: 1 addition & 1 deletion lib/python/qmk/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_hello():
def test_format_python():
result = check_subcommand('format-python', '--dry-run')
check_returncode(result)
assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout
assert 'Python code in `lib/python` is correctly formatted.' in result.stdout


def test_list_keyboards():
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
projectDir = ./util/nix;
overrides = poetry2nix.overrides.withDefaults (self: super: {
qmk = super.qmk.overridePythonAttrs(old: {
# Allow QMK CLI to run "bin/qmk" as a subprocess (the wrapper changes
# Allow QMK CLI to run "qmk" as a subprocess (the wrapper changes
# $PATH and breaks these invocations).
dontWrapPythonPrograms = true;
});
Expand Down

0 comments on commit 596c4a1

Please sign in to comment.