Migrate setup.cfg to pyproject.toml (#236)

This commit is contained in:
Joel Challis
2026-06-29 04:07:19 +01:00
committed by GitHub
parent 5e57fdefe0
commit 05d1c36f49
14 changed files with 139 additions and 130 deletions
+1 -1
View File
@@ -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
View File
@@ -0,0 +1,6 @@
[flake8]
ignore = E501
exclude =
__pycache__
.direnv
.env
+1 -1
View File
@@ -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: |
+1 -1
View File
@@ -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: |
+1 -1
View File
@@ -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:
-1
View File
@@ -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'"
+118 -4
View File
@@ -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
View File
@@ -2,4 +2,5 @@
"""Wrapper to call the qmk cli script entrypoint.
"""
import qmk_cli.script_qmk
qmk_cli.script_qmk.main()
+2 -2
View File
@@ -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:
@@ -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
+3 -3
View File
@@ -43,7 +43,7 @@ milc.cli.milc_options(version=__version__)
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.')
@@ -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):
@@ -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':
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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?"
-3
View File
@@ -1,3 +0,0 @@
build
bumpversion
twine
-108
View File
@@ -1,108 +0,0 @@
#[bumpversion]
# Bumpversion config has been moved to .bumpversion.cfg
[bdist_wheel]
universal = 1
[flake8]
ignore = E501,E226
[metadata]
name = qmk
version = 1.2.0
author = skullydazed
author_email = skullydazed@gmail.com
description = A program to help users work with QMK Firmware.
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT License
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/
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Developers
Intended Audience :: System Administrators
Intended Audience :: End Users/Desktop
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: Utilities
[options]
install_requires =
hid
milc>=1.9.0
platformdirs
pyusb
# qmk_firmware packages
dotty-dict
hjson
jsonschema>=4
pillow
pygments
pyserial
packages = find:
python_requires = >=3.9
[options.entry_points]
console_scripts =
qmk = qmk_cli.script_qmk:main
[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