Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ message = New release: {current_version} → {new_version}

[bumpversion:file:qmk_cli/__init__.py]

[bumpversion:file:setup.cfg]
[bumpversion:file:pyproject.toml]
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
ignore = E501
exclude =
__pycache__
.direnv
.env
2 changes: 1 addition & 1 deletion .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements-dev.txt
pip install --group dev

- name: Build Python
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements-dev.txt
pip install --group dev

- name: Bump version
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ We follow PEP517, you can install using [build](https://pypi.org/project/build/)

Setup:

python3 -m pip install build
python3 -m pip install --group dev

Build:

Expand Down
1 change: 0 additions & 1 deletion ci_tests
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ source .ci_venv/bin/activate
# Install dependencies
python3 -m pip install -U pip wheel
python3 -m pip install .
python3 -m pip install -r requirements-dev.txt

# Ensure that qmk works
echo "*** Testing 'qmk clone -h'"
Expand Down
122 changes: 118 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,120 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
requires = ["setuptools>=82.0.1"]
build-backend = "setuptools.build_meta"

[project]
name = "qmk"
version = "1.2.0"
license = "MIT"
readme = "README.md"
authors = [{name = "skullydazed", email = "skullydazed@gmail.com"}]
description = "A program to help users work with QMK Firmware."
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: End Users/Desktop",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Topic :: Utilities",
]
requires-python = ">=3.9"
dependencies = [
"hid",
"milc>=1.9.0",
"platformdirs",
"pyusb",
# qmk_firmware packages
"dotty-dict",
"hjson",
"jsonschema>=4",
"pillow",
"pygments",
"pyserial",
]

[dependency-groups]
dev = [
"build",
"bumpversion",
"flake8",
"twine",
"yapf",
]

[project.urls]
"Bug Tracker" = "https://github.com/qmk/qmk_cli/issues"
Documentation = "https://docs.qmk.fm/cli"
Homepage = "https://qmk.fm/"
Source = "https://github.com/qmk/qmk_cli/"

[project.scripts]
qmk = "qmk_cli.script_qmk:main"

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages]
find = {namespaces = false}

[tool.yapfignore]
ignore_patterns = [
".direnv/**/*",
".env/**/*",
]

[tool.yapf]
align_closing_bracket_with_visual_indent = true
allow_multiline_dictionary_keys = false
allow_multiline_lambdas = false
allow_split_before_default_or_named_assigns = true
allow_split_before_dict_value = true
arithmetic_precedence_indication = true
blank_lines_around_top_level_definition = 2
blank_line_before_class_docstring = false
blank_line_before_module_docstring = false
blank_line_before_nested_class_or_def = false
coalesce_brackets = true
column_limit = 256
continuation_align_style = "SPACE"
continuation_indent_width = 4
dedent_closing_brackets = true
disable_ending_comma_heuristic = false
each_dict_entry_on_separate_line = true
i18n_comment = ""
i18n_function_call = ""
indent_blank_lines = false
indent_dictionary_value = true
indent_width = 4
join_multiple_lines = false
no_spaces_around_selected_binary_operators = ""
spaces_around_default_or_named_assign = false
spaces_around_power_operator = false
spaces_before_comment = 2
space_between_ending_comma_and_closing_bracket = false
split_all_comma_separated_values = false
split_arguments_when_comma_terminated = true
split_before_arithmetic_operator = false
split_before_bitwise_operator = true
split_before_closing_bracket = true
split_before_dict_set_generator = true
split_before_dot = false
split_before_expression_after_opening_paren = false
split_before_first_argument = false
split_before_logical_operator = false
split_before_named_assigns = true
split_complex_comprehension = true
split_penalty_after_opening_bracket = 300
split_penalty_after_unary_operator = 10000
split_penalty_arithmetic_operator = 300
split_penalty_before_if_expr = 0
split_penalty_bitwise_operator = 300
split_penalty_comprehension = 80
split_penalty_excess_character = 7000
split_penalty_for_added_line_split = 30
split_penalty_import_names = 0
split_penalty_logical_operator = 300
use_tabs = false
1 change: 1 addition & 0 deletions qmk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"""Wrapper to call the qmk cli script entrypoint.
"""
import qmk_cli.script_qmk

qmk_cli.script_qmk.main()
4 changes: 2 additions & 2 deletions qmk_cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def is_qmk_firmware(qmk_firmware):
qmk_firmware / 'quantum',
qmk_firmware / 'requirements.txt',
qmk_firmware / 'requirements-dev.txt',
qmk_firmware / 'lib/python/qmk/cli/__init__.py'
qmk_firmware / 'lib/python/qmk/cli/__init__.py',
]

for path in paths:
Expand Down Expand Up @@ -80,7 +80,7 @@ def is_qmk_userspace(qmk_userspace):

try:
return 'userspace_version' in json.loads(path.read_text(encoding="UTF-8"))
except json.decoder.JSONDecodeError as e:
except json.decoder.JSONDecodeError:
return False


Expand Down
6 changes: 3 additions & 3 deletions qmk_cli/script_qmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _get_default_distrib_path():
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'

# These must happen after the milc.milc_options() call
import milc.subcommand.config # noqa, must come after milc.milc_options()
import milc.subcommand.config # noqa: E402, must come after milc.milc_options()


@milc.cli.entrypoint('CLI wrapper for running QMK commands.')
Expand Down Expand Up @@ -83,7 +83,7 @@ def main():
os.environ['QMK_HOME'] = str(qmk_firmware)
os.environ['ORIG_CWD'] = os.getcwd()

import qmk_cli.subcommands
import qmk_cli.subcommands # noqa: F401

# Check out and initialize the qmk_firmware environment
if is_qmk_firmware(qmk_firmware):
Expand All @@ -92,7 +92,7 @@ def main():
sys.path.append(str(qmk_firmware / 'lib/python'))

try:
import qmk.cli # noqa
import qmk.cli # noqa: F401

except ImportError as e:
if qmk_firmware.name != 'qmk_firmware':
Expand Down
8 changes: 4 additions & 4 deletions qmk_cli/subcommands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
"""
from . import clone # noqa
from . import console # noqa
from . import env # noqa
from . import setup # noqa
from . import clone # noqa: F401
from . import console # noqa: F401
from . import env # noqa: F401
from . import setup # noqa: F401
2 changes: 1 addition & 1 deletion qmk_cli/subcommands/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def setup(cli):
found_options = [
f"Delete and reclone {cli.args.fork}",
"Delete and clone a different fork",
"Keep it and continue"
"Keep it and continue",
]
delete_confirm = "WARNING: This will delete your current qmk_firmware directory. Proceed?"

Expand Down
3 changes: 0 additions & 3 deletions requirements-dev.txt

This file was deleted.

108 changes: 0 additions & 108 deletions setup.cfg

This file was deleted.

Loading