From c248b69185247d0487a1fde4df3a0f23c85f3c19 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Fri, 20 Sep 2024 03:09:56 +0000 Subject: [PATCH 1/5] Merge setup.cfg into pyproject.toml --- Makefile | 2 +- pyproject.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 47 ------------------------------------------ 3 files changed, 56 insertions(+), 48 deletions(-) delete mode 100644 setup.cfg diff --git a/Makefile b/Makefile index 346fb1e04..30da61da0 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ fix-formatting: devdeps @$(PIPENV) run black . fix-isort: devdeps - @find boards/ kmk/ tests/ user_keymaps/ -name "*.py" | xargs $(PIPENV) run isort + @$(PIPENV) run isort . clean: clean-dist @echo "===> Cleaning build artifacts" diff --git a/pyproject.toml b/pyproject.toml index 3cc2fdef3..392f62e64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,3 +20,58 @@ exclude = ''' | mnt )/ ''' + +[tool.flake8] +filename = [ + './boards/*.py', + './kmk/*.py', + './tests/*.py', + './user_keymaps/*.py', +] +# match black expectations +max-line-length = 88 + +# enforce single quotes +docstring-quotes = "'''" +multiline-quotes = "'''" + +extend-ignore = [ +# manage trailing commas + 'C812', 'C813', +# ignore: comment should start with '# ' + 'E262', +# manage line lengths + 'E501', +] + +per-file-ignores = [ +# Allow misaligned array entries + 'boards/**/*.py: E131', + 'user_keymaps/**/*.py: E131', +] + +[tool.isort] +known_standard_library = [ + 'analogio', + 'bitbangio', + 'bleio', + 'board', + 'busio', + 'digitalio', + 'framebuf', + 'gc', + 'machine', + 'microcontroller', + 'micropython', + 'neopixel', + 'pulseio', + 'supervisor', + 'usb_hid' +] +profile = 'black' +skip_glob = [ + '!boards/*.py', + '!kmk/*.py', + '!tests/*.py', + '!user_keymaps/*.py', +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 31e241670..000000000 --- a/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -[flake8] -exclude = .git,__pycache__,vendor,.venv,build,dist,.compiled,mnt -# match black expectations -max_line_length = 88 - -# enforce single quotes -docstring-quotes = ''' -multiline-quotes = ''' - -extend-ignore = -# ignore: comment should start with '# ' - E262, -# comply with black -# it will handle line lengths automatically - E501, -# it also controls trailing commas in general - C812, C813 - -per-file-ignores = -# Allow misaligned array entries - user_keymaps/**/*.py: E131 - boards/**/*.py: E131 - -[isort] -known_standard_library = - analogio, - bitbangio, - bleio, - board, - busio, - digitalio, - framebuf, - gc, - machine, - microcontroller, - micropython, - neopixel, - pulseio, - supervisor, - usb_hid, - -# black compat -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses=True -line_length=88 From 3f268a94c065b6846b1010b9bf1dc89eb6f7be79 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Fri, 20 Sep 2024 03:10:14 +0000 Subject: [PATCH 2/5] Use includes instead of excludes for black --- pyproject.toml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 392f62e64..41c86c285 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,23 +2,14 @@ # since black refuses to allow single-quotes... see locked conversation at # https://github.com/psf/black/issues/594 skip-string-normalization = true -# explicitly exclude user_keymaps from black formatting rules -# because a visually-appealing keymap list will be flattened -# by black into a much harder to understand format target-version = ['py36'] -exclude = ''' +include = ''' /( - \.git - | \.mypy_cache - | \.tox - | \.venv - | \.pytest_cache - | \.compiled - | dist - | build - | docs - | mnt -)/ + boards + |kmk + |tests + |user_keymaps +)/.*\.py ''' [tool.flake8] From 9128e5d59d4f4385c1d40df41b055585860de341 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Fri, 20 Sep 2024 03:10:30 +0000 Subject: [PATCH 3/5] Remove pipenv dependency --- .github/workflows/test.yml | 2 +- Makefile | 30 +-- Pipfile | 22 -- Pipfile.lock | 503 ------------------------------------- pyproject.toml | 20 ++ 5 files changed, 37 insertions(+), 540 deletions(-) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf685ed35..5eabed4c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,5 +12,5 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax - - run: python -m pip install --upgrade pipenv wheel + - run: make devdeps - run: make test diff --git a/Makefile b/Makefile index 30da61da0..fd83d9b2b 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,8 @@ DOCKER_TAG ?= latest AMPY_PORT ?= /dev/ttyUSB0 AMPY_BAUD ?= 115200 AMPY_DELAY ?= 1.5 -PIPENV ?= $(shell which pipenv 2>/dev/null) +VENV ?= .venv +PYTHON = $(VENV)/bin/python MPY_CROSS ?= $(shell which mpy-cross 2>/dev/null) MPY_FLAGS ?= '-O2' @@ -44,12 +45,13 @@ $(MPY_TARGET_DIR)/%.mpy: %.py @$(MPY_CROSS) $(MPY_FLAGS) $? -o $@ endif -.devdeps: Pipfile.lock - @echo "===> Installing dependencies with pipenv" - @$(PIPENV) sync --dev - @touch .devdeps +$(VENV): + @echo "===> Installing virtual environment" + python -m venv $(VENV) + $(PYTHON) -m pip install --upgrade pip + $(PYTHON) -m pip install .[dev] -devdeps: .devdeps +devdeps: $(VENV) dist: clean-dist dockerbase @mkdir -p .dist @@ -62,20 +64,22 @@ dockerbase: --build-arg KMKPY_REF=$$(cut -f2 < kmkpython_ref.tsv) lint: devdeps - @$(PIPENV) run flake8 + @$(PYTHON) -m flake8 spellcheck: ./util/spellcheck.sh --no-interactive fix-formatting: devdeps - @$(PIPENV) run black . + @$(PYTHON) -m black . fix-isort: devdeps - @$(PIPENV) run isort . + @$(PYTHON) -m isort . clean: clean-dist @echo "===> Cleaning build artifacts" - @rm -rf .devdeps build dist $(MPY_TARGET_DIR) + rm -rf .venv build dist $(MPY_TARGET_DIR) + find . -type f -name '*.pyc' -delete + find . -type d -name '__pycache__' -delete clean-dist: @echo "===> Cleaning KMKPython dists" @@ -88,8 +92,6 @@ clean-dist: powerwash: clean @echo "===> Removing vendor/ to force a re-pull" @rm -rf vendor - @echo "===> Removing pipenv-managed virtual environment" - @$(PIPENV) --rm || true test: lint unit-tests @@ -97,9 +99,9 @@ TESTS ?= tests .PHONY: unit-tests unit-tests: devdeps ifdef TESTS - @$(PIPENV) run python3 -m unittest $(TESTS) + $(PYTHON) -m unittest $(TESTS) else - @$(PIPENV) run python3 -m unittest discover -t . -s tests + $(PYTHON) -m unittest discover -t . -s tests endif # TESTS reset-bootloader: diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 995e7ddd2..000000000 --- a/Pipfile +++ /dev/null @@ -1,22 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] - -[dev-packages] -flake8 = "==7.0.0" -flake8-commas = "*" -flake8-comprehensions = "*" -flake8-isort = "*" -python-magic = "*" -adafruit-ampy = "*" -ipdb = "*" -ipython = "*" -isort = "*" -neovim = "*" -s3cmd = "*" -black = "==24.4.2" -flake8-quotes = "*" -flake8-black = "*" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index 2398e95cb..000000000 --- a/Pipfile.lock +++ /dev/null @@ -1,503 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "33d129cc53993b55d01b08b45c1a7c09e5e95bbdda97ec3f2b6dd7b65229118d" - }, - "pipfile-spec": 6, - "requires": {}, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": {}, - "develop": { - "adafruit-ampy": { - "hashes": [ - "sha256:4a74812226e53c17d01eb828633424bc4f4fe76b9499a7b35eba6fc2532635b7", - "sha256:f4cba36f564096f2aafd173f7fbabb845365cc3bb3f41c37541edf98b58d3976" - ], - "index": "pypi", - "version": "==1.1.0" - }, - "asttokens": { - "hashes": [ - "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24", - "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0" - ], - "version": "==2.4.1" - }, - "black": { - "hashes": [ - "sha256:257d724c2c9b1660f353b36c802ccece186a30accc7742c176d29c146df6e474", - "sha256:37aae07b029fa0174d39daf02748b379399b909652a806e5708199bd93899da1", - "sha256:415e686e87dbbe6f4cd5ef0fbf764af7b89f9057b97c908742b6008cc554b9c0", - "sha256:48a85f2cb5e6799a9ef05347b476cce6c182d6c71ee36925a6c194d074336ef8", - "sha256:7768a0dbf16a39aa5e9a3ded568bb545c8c2727396d063bbaf847df05b08cd96", - "sha256:7e122b1c4fb252fd85df3ca93578732b4749d9be076593076ef4d07a0233c3e1", - "sha256:88c57dc656038f1ab9f92b3eb5335ee9b021412feaa46330d5eba4e51fe49b04", - "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021", - "sha256:98e123f1d5cfd42f886624d84464f7756f60ff6eab89ae845210631714f6db94", - "sha256:accf49e151c8ed2c0cdc528691838afd217c50412534e876a19270fea1e28e2d", - "sha256:b1530ae42e9d6d5b670a34db49a94115a64596bc77710b1d05e9801e62ca0a7c", - "sha256:b9176b9832e84308818a99a561e90aa479e73c523b3f77afd07913380ae2eab7", - "sha256:bdde6f877a18f24844e381d45e9947a49e97933573ac9d4345399be37621e26c", - "sha256:be8bef99eb46d5021bf053114442914baeb3649a89dc5f3a555c88737e5e98fc", - "sha256:bf10f7310db693bb62692609b397e8d67257c55f949abde4c67f9cc574492cc7", - "sha256:c872b53057f000085da66a19c55d68f6f8ddcac2642392ad3a355878406fbd4d", - "sha256:d36ed1124bb81b32f8614555b34cc4259c3fbc7eec17870e8ff8ded335b58d8c", - "sha256:da33a1a5e49c4122ccdfd56cd021ff1ebc4a1ec4e2d01594fef9b6f267a9e741", - "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce", - "sha256:e151054aa00bad1f4e1f04919542885f89f5f7d086b8a59e5000e6c616896ffb", - "sha256:eaea3008c281f1038edb473c1aa8ed8143a5535ff18f978a318f10302b254063", - "sha256:ef703f83fc32e131e9bcc0a5094cfe85599e7109f896fe8bc96cc402f3eb4b6e" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==24.4.2" - }, - "click": { - "hashes": [ - "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", - "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" - ], - "markers": "python_version >= '3.7'", - "version": "==8.1.7" - }, - "decorator": { - "hashes": [ - "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330", - "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186" - ], - "markers": "python_version >= '3.11'", - "version": "==5.1.1" - }, - "executing": { - "hashes": [ - "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147", - "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc" - ], - "markers": "python_version >= '3.5'", - "version": "==2.0.1" - }, - "flake8": { - "hashes": [ - "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132", - "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3" - ], - "index": "pypi", - "markers": "python_full_version >= '3.8.1'", - "version": "==7.0.0" - }, - "flake8-black": { - "hashes": [ - "sha256:0dfbca3274777792a5bcb2af887a4cad72c72d0e86c94e08e3a3de151bb41c34", - "sha256:fe8ea2eca98d8a504f22040d9117347f6b367458366952862ac3586e7d4eeaca" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==0.3.6" - }, - "flake8-commas": { - "hashes": [ - "sha256:a68834b42a9a31c94ca790efe557a932c0eae21a3479c6b9a23c4dc077e3ea96", - "sha256:cad476d71ba72e8b941a8508d5b9ffb6b03e50f7102982474f085ad0d674b685" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==4.0.0" - }, - "flake8-comprehensions": { - "hashes": [ - "sha256:7b9d07d94aa88e62099a6d1931ddf16c344d4157deedf90fe0d8ee2846f30e97", - "sha256:81768c61bfc064e1a06222df08a2580d97de10cb388694becaf987c331c6c0cf" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==3.14.0" - }, - "flake8-isort": { - "hashes": [ - "sha256:0fec4dc3a15aefbdbe4012e51d5531a2eb5fa8b981cdfbc882296a59b54ede12", - "sha256:c1f82f3cf06a80c13e1d09bfae460e9666255d5c780b859f19f8318d420370b3" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==6.1.1" - }, - "flake8-quotes": { - "hashes": [ - "sha256:aad8492fb710a2d3eabe68c5f86a1428de650c8484127e14c43d0504ba30276c" - ], - "index": "pypi", - "version": "==3.4.0" - }, - "greenlet": { - "hashes": [ - "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67", - "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6", - "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257", - "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4", - "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676", - "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61", - "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc", - "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca", - "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7", - "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728", - "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305", - "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6", - "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379", - "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414", - "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04", - "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a", - "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf", - "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491", - "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559", - "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e", - "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274", - "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb", - "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b", - "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9", - "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b", - "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be", - "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506", - "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405", - "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113", - "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f", - "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5", - "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230", - "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d", - "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f", - "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a", - "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e", - "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61", - "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6", - "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d", - "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71", - "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22", - "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2", - "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3", - "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067", - "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc", - "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881", - "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3", - "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e", - "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac", - "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53", - "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0", - "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b", - "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83", - "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41", - "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c", - "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf", - "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da", - "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33" - ], - "markers": "python_version >= '3.7'", - "version": "==3.0.3" - }, - "ipdb": { - "hashes": [ - "sha256:45529994741c4ab6d2388bfa5d7b725c2cf7fe9deffabdb8a6113aa5ed449ed4", - "sha256:e3ac6018ef05126d442af680aad863006ec19d02290561ac88b8b1c0b0cfc726" - ], - "index": "pypi", - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.13.13" - }, - "ipython": { - "hashes": [ - "sha256:010db3f8a728a578bb641fdd06c063b9fb8e96a9464c63aec6310fbcb5e80501", - "sha256:d7bf2f6c4314984e3e02393213bab8703cf163ede39672ce5918c51fe253a2a3" - ], - "index": "pypi", - "markers": "python_version >= '3.10'", - "version": "==8.24.0" - }, - "isort": { - "hashes": [ - "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", - "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6" - ], - "index": "pypi", - "markers": "python_full_version >= '3.8.0'", - "version": "==5.13.2" - }, - "jedi": { - "hashes": [ - "sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd", - "sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0" - ], - "markers": "python_version >= '3.6'", - "version": "==0.19.1" - }, - "matplotlib-inline": { - "hashes": [ - "sha256:8423b23ec666be3d16e16b60bdd8ac4e86e840ebd1dd11a30b9f117f2fa0ab90", - "sha256:df192d39a4ff8f21b1895d72e6a13f5fcc5099f00fa84384e0ea28c2cc0653ca" - ], - "markers": "python_version >= '3.8'", - "version": "==0.1.7" - }, - "mccabe": { - "hashes": [ - "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", - "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" - ], - "markers": "python_version >= '3.6'", - "version": "==0.7.0" - }, - "msgpack": { - "hashes": [ - "sha256:00e073efcba9ea99db5acef3959efa45b52bc67b61b00823d2a1a6944bf45982", - "sha256:0726c282d188e204281ebd8de31724b7d749adebc086873a59efb8cf7ae27df3", - "sha256:0ceea77719d45c839fd73abcb190b8390412a890df2f83fb8cf49b2a4b5c2f40", - "sha256:114be227f5213ef8b215c22dde19532f5da9652e56e8ce969bf0a26d7c419fee", - "sha256:13577ec9e247f8741c84d06b9ece5f654920d8365a4b636ce0e44f15e07ec693", - "sha256:1876b0b653a808fcd50123b953af170c535027bf1d053b59790eebb0aeb38950", - "sha256:1ab0bbcd4d1f7b6991ee7c753655b481c50084294218de69365f8f1970d4c151", - "sha256:1cce488457370ffd1f953846f82323cb6b2ad2190987cd4d70b2713e17268d24", - "sha256:26ee97a8261e6e35885c2ecd2fd4a6d38252246f94a2aec23665a4e66d066305", - "sha256:3528807cbbb7f315bb81959d5961855e7ba52aa60a3097151cb21956fbc7502b", - "sha256:374a8e88ddab84b9ada695d255679fb99c53513c0a51778796fcf0944d6c789c", - "sha256:376081f471a2ef24828b83a641a02c575d6103a3ad7fd7dade5486cad10ea659", - "sha256:3923a1778f7e5ef31865893fdca12a8d7dc03a44b33e2a5f3295416314c09f5d", - "sha256:4916727e31c28be8beaf11cf117d6f6f188dcc36daae4e851fee88646f5b6b18", - "sha256:493c5c5e44b06d6c9268ce21b302c9ca055c1fd3484c25ba41d34476c76ee746", - "sha256:505fe3d03856ac7d215dbe005414bc28505d26f0c128906037e66d98c4e95868", - "sha256:5845fdf5e5d5b78a49b826fcdc0eb2e2aa7191980e3d2cfd2a30303a74f212e2", - "sha256:5c330eace3dd100bdb54b5653b966de7f51c26ec4a7d4e87132d9b4f738220ba", - "sha256:5dbf059fb4b7c240c873c1245ee112505be27497e90f7c6591261c7d3c3a8228", - "sha256:5e390971d082dba073c05dbd56322427d3280b7cc8b53484c9377adfbae67dc2", - "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273", - "sha256:64d0fcd436c5683fdd7c907eeae5e2cbb5eb872fafbc03a43609d7941840995c", - "sha256:69284049d07fce531c17404fcba2bb1df472bc2dcdac642ae71a2d079d950653", - "sha256:6a0e76621f6e1f908ae52860bdcb58e1ca85231a9b0545e64509c931dd34275a", - "sha256:73ee792784d48aa338bba28063e19a27e8d989344f34aad14ea6e1b9bd83f596", - "sha256:74398a4cf19de42e1498368c36eed45d9528f5fd0155241e82c4082b7e16cffd", - "sha256:7938111ed1358f536daf311be244f34df7bf3cdedb3ed883787aca97778b28d8", - "sha256:82d92c773fbc6942a7a8b520d22c11cfc8fd83bba86116bfcf962c2f5c2ecdaa", - "sha256:83b5c044f3eff2a6534768ccfd50425939e7a8b5cf9a7261c385de1e20dcfc85", - "sha256:8db8e423192303ed77cff4dce3a4b88dbfaf43979d280181558af5e2c3c71afc", - "sha256:9517004e21664f2b5a5fd6333b0731b9cf0817403a941b393d89a2f1dc2bd836", - "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3", - "sha256:99881222f4a8c2f641f25703963a5cefb076adffd959e0558dc9f803a52d6a58", - "sha256:9ee32dcb8e531adae1f1ca568822e9b3a738369b3b686d1477cbc643c4a9c128", - "sha256:a22e47578b30a3e199ab067a4d43d790249b3c0587d9a771921f86250c8435db", - "sha256:b5505774ea2a73a86ea176e8a9a4a7c8bf5d521050f0f6f8426afe798689243f", - "sha256:bd739c9251d01e0279ce729e37b39d49a08c0420d3fee7f2a4968c0576678f77", - "sha256:d16a786905034e7e34098634b184a7d81f91d4c3d246edc6bd7aefb2fd8ea6ad", - "sha256:d3420522057ebab1728b21ad473aa950026d07cb09da41103f8e597dfbfaeb13", - "sha256:d56fd9f1f1cdc8227d7b7918f55091349741904d9520c65f0139a9755952c9e8", - "sha256:d661dc4785affa9d0edfdd1e59ec056a58b3dbb9f196fa43587f3ddac654ac7b", - "sha256:dfe1f0f0ed5785c187144c46a292b8c34c1295c01da12e10ccddfc16def4448a", - "sha256:e1dd7839443592d00e96db831eddb4111a2a81a46b028f0facd60a09ebbdd543", - "sha256:e2872993e209f7ed04d963e4b4fbae72d034844ec66bc4ca403329db2074377b", - "sha256:e2f879ab92ce502a1e65fce390eab619774dda6a6ff719718069ac94084098ce", - "sha256:e3aa7e51d738e0ec0afbed661261513b38b3014754c9459508399baf14ae0c9d", - "sha256:e532dbd6ddfe13946de050d7474e3f5fb6ec774fbb1a188aaf469b08cf04189a", - "sha256:e6b7842518a63a9f17107eb176320960ec095a8ee3b4420b5f688e24bf50c53c", - "sha256:e75753aeda0ddc4c28dce4c32ba2f6ec30b1b02f6c0b14e547841ba5b24f753f", - "sha256:eadb9f826c138e6cf3c49d6f8de88225a3c0ab181a9b4ba792e006e5292d150e", - "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011", - "sha256:ef254a06bcea461e65ff0373d8a0dd1ed3aa004af48839f002a0c994a6f72d04", - "sha256:f3709997b228685fe53e8c433e2df9f0cdb5f4542bd5114ed17ac3c0129b0480", - "sha256:f51bab98d52739c50c56658cc303f190785f9a2cd97b823357e7aeae54c8f68a", - "sha256:f9904e24646570539a8950400602d66d2b2c492b9010ea7e965025cb71d0c86d", - "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d" - ], - "markers": "python_version >= '3.8'", - "version": "==1.0.8" - }, - "mypy-extensions": { - "hashes": [ - "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", - "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782" - ], - "markers": "python_version >= '3.5'", - "version": "==1.0.0" - }, - "neovim": { - "hashes": [ - "sha256:a6a0e7a5b4433bf4e6ddcbc5c5ff44170be7d84259d002b8e8d8fb4ee78af60f" - ], - "index": "pypi", - "version": "==0.3.1" - }, - "packaging": { - "hashes": [ - "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", - "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" - ], - "markers": "python_version >= '3.7'", - "version": "==24.0" - }, - "parso": { - "hashes": [ - "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18", - "sha256:eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d" - ], - "markers": "python_version >= '3.6'", - "version": "==0.8.4" - }, - "pathspec": { - "hashes": [ - "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", - "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712" - ], - "markers": "python_version >= '3.8'", - "version": "==0.12.1" - }, - "pexpect": { - "hashes": [ - "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523", - "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f" - ], - "markers": "sys_platform != 'win32' and sys_platform != 'emscripten'", - "version": "==4.9.0" - }, - "platformdirs": { - "hashes": [ - "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee", - "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3" - ], - "markers": "python_version >= '3.8'", - "version": "==4.2.2" - }, - "prompt-toolkit": { - "hashes": [ - "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d", - "sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6" - ], - "markers": "python_full_version >= '3.7.0'", - "version": "==3.0.43" - }, - "ptyprocess": { - "hashes": [ - "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35", - "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220" - ], - "version": "==0.7.0" - }, - "pure-eval": { - "hashes": [ - "sha256:01eaab343580944bc56080ebe0a674b39ec44a945e6d09ba7db3cb8cec289350", - "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3" - ], - "version": "==0.2.2" - }, - "pycodestyle": { - "hashes": [ - "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f", - "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67" - ], - "markers": "python_version >= '3.8'", - "version": "==2.11.1" - }, - "pyflakes": { - "hashes": [ - "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f", - "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a" - ], - "markers": "python_version >= '3.8'", - "version": "==3.2.0" - }, - "pygments": { - "hashes": [ - "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", - "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a" - ], - "markers": "python_version >= '3.8'", - "version": "==2.18.0" - }, - "pynvim": { - "hashes": [ - "sha256:2ac197ef0cdfff53719184a45c33cfb7cef88d1c9bf7f0525c21b3239cb5365f", - "sha256:e80a11f6f5d194c6a47bea4135b90b55faca24da3544da7cf4a5f7ba8fb09215" - ], - "markers": "python_version >= '3.7'", - "version": "==0.5.0" - }, - "pyserial": { - "hashes": [ - "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb", - "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0" - ], - "version": "==3.5" - }, - "python-dateutil": { - "hashes": [ - "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", - "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.9.0.post0" - }, - "python-dotenv": { - "hashes": [ - "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", - "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a" - ], - "markers": "python_version >= '3.8'", - "version": "==1.0.1" - }, - "python-magic": { - "hashes": [ - "sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b", - "sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3" - ], - "index": "pypi", - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==0.4.27" - }, - "s3cmd": { - "hashes": [ - "sha256:13ad8a44d44cc0535ba8c878c91fd68cd830dc48f6388722fa44a7aaf3f18017", - "sha256:6b567521be1c151323f2059c8feec85ded96b6f184ff80535837fea33798b40b" - ], - "index": "pypi", - "version": "==2.4.0" - }, - "setuptools": { - "hashes": [ - "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4", - "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0" - ], - "markers": "python_version >= '3.8'", - "version": "==70.0.0" - }, - "six": { - "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" - }, - "stack-data": { - "hashes": [ - "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9", - "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695" - ], - "version": "==0.6.3" - }, - "traitlets": { - "hashes": [ - "sha256:9ed0579d3502c94b4b3732ac120375cda96f923114522847de4b3bb98b96b6b7", - "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f" - ], - "markers": "python_version >= '3.8'", - "version": "==5.14.3" - }, - "wcwidth": { - "hashes": [ - "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859", - "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5" - ], - "version": "==0.2.13" - } - } -} diff --git a/pyproject.toml b/pyproject.toml index 41c86c285..270664b39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,23 @@ +[project] +name = 'kmk_firmware' +dependencies = [] +version = '0' +requires-python = '>=3.10' + +[project.optional-dependencies] +dev = [ + 'flake8==7.0.0', + 'flake8-black', + 'flake8-commas', + 'flake8-comprehensions', + 'flake8-isort', + 'flake8-pyproject', + 'flake8-quotes', +] + +[tool.setuptools] +packages = [] + [tool.black] # since black refuses to allow single-quotes... see locked conversation at # https://github.com/psf/black/issues/594 From 8a6d856bcd4f0f21f435563f5e8a297aa204a1b5 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Fri, 20 Sep 2024 17:42:24 +0000 Subject: [PATCH 4/5] Keep spellcheck from searching hidden directories. Otherwise spellcheck will search for example in `.venv` for typos in tooling packages. Maybe the search expression should be a positive list. --- util/spellcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/spellcheck.sh b/util/spellcheck.sh index 7fd42b537..79774d1c6 100755 --- a/util/spellcheck.sh +++ b/util/spellcheck.sh @@ -8,7 +8,7 @@ fi ROOT=$(git rev-parse --show-toplevel) # This gets us only english .md files at the moment, but is clearly brittle -MARKDOWN_FILES=$(find "$ROOT" -name '*.md' -not -path '**/ptBR/**' -not -path '**/*-ptBR.md' -not -path '**/ja/**') +MARKDOWN_FILES=$(find "$ROOT" -name '*.md' -not -path '**/ptBR/**' -not -path '**/*-ptBR.md' -not -path '**/ja/**' -not -path '**/.*/**') # Use our local dict for saved words, and use en_US for the main dict ASPELL="aspell -M --dont-save-repl -p $ROOT/util/aspell.en.pws -d en_US" From 91c150820a57ab762c5744b1fef888e4e9fe51b3 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Mon, 7 Oct 2024 06:49:58 +0000 Subject: [PATCH 5/5] Remove the last non-english doc and simplify spellcheck search --- hardware/README-ptBR.md | 67 ----------------------------------------- util/spellcheck.sh | 2 +- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 hardware/README-ptBR.md diff --git a/hardware/README-ptBR.md b/hardware/README-ptBR.md deleted file mode 100644 index 7fd1319a9..000000000 --- a/hardware/README-ptBR.md +++ /dev/null @@ -1,67 +0,0 @@ -# KMK Hardware: Dispositivos para Uso Com KMK - -## Adaptador de Pinagem de Itsy Bitsy para Pro Micro - -Esta placa adapta a pinagem de uma [Adafruit Itsy Bitsy M4 -Express](https://www.adafruit.com/product/3800) compatível com o CircuitPython -para aquela da [SparkFun Pro Micro](https://www.sparkfun.com/products/12640) a -fim de permitir que a Itsy Bitsy seja usável com os diversos teclados que -suportam a planta do Pro Micro. - -## Mapeamento dos Pinos - -| Pro Micro | Itsy Bitsy | -|-----------|------------| -| TX0/PD3 | TX | -| RX1/PD2 | RX | -| GND | GND | -| GND | GND | -| 2/PD1 | SDA | -| 3/PD0 | SCL | -| 4/PD4 | D13 | -| 5/PC6 | D12 | -| 6/PD7 | D11 | -| 7/PE6 | D10 | -| 8/PB4 | D9 | -| 9/PB5 | D7 | -| Raw | | -| GND | GND | -| RST | RST | -| VCC | USB | -| A3/PF4 | A0 | -| A2/PF5 | A1 | -| A1/PF6 | A2 | -| A0/PF7 | A3 | -| 15/PB1 | A4 | -| 14/PB3 | A5 | -| 16/PB2 | SCK | - - -## Então como eu uso isso? - -1. Os contatos da planta do Pro Micro são circuladas na parte inferior da - placa. Solde os cabeçotes-macho nestes contatos por baixo da placa (o mesmo - lado das marcas) de forma que os pinos estendam-se "para baixo" para que - possam ser plugados no teclado. - -2. Os contatos restantes são para a Itsy Bitsy. Asssumindo que a altura seja uma - preocupação, em vez de soldar os cabeçotes-macho na Itsy Bitsy e os - cabeçotes-fêmea na placa adaptadora, coloque o lado longo dos cabeçotes-macho - ao longo dos contatos da Itsy Bitsy por baixo da placa de forma que eles - projetem-se ao longo dos contatos no topo da placa e soldá-los no - lugar. Certifique-se de manter os cabeçotes perpendiculares à superfície da - placa. - -3. Uma vez soldados, coloque a placa Itsy Bitsy acima dos cabeçotes que agora - estão ressaltando para cima de forma que os cabeçalhos passem pelas pads do - Itsy Bitsy e soldem no lugar. - -4. Apare os cabeçotes do Itsy Bits o quanto for necessário com um nivelador. - - -## Licença, Direitos de Cópia, e Detalhes Jurídicos - -Os arquivos deste diretório estão licenciados pela [CC BY-SA -4.0](https://tldrlegal.com/license/creative-commons-attribution-sharealike-4.0-international-(cc-by-sa-4.0)) -onde o resumo está ligado, cujo texto completo está no arquivo `LICENSE.md` -neste diretório. diff --git a/util/spellcheck.sh b/util/spellcheck.sh index 79774d1c6..121c0f147 100755 --- a/util/spellcheck.sh +++ b/util/spellcheck.sh @@ -8,7 +8,7 @@ fi ROOT=$(git rev-parse --show-toplevel) # This gets us only english .md files at the moment, but is clearly brittle -MARKDOWN_FILES=$(find "$ROOT" -name '*.md' -not -path '**/ptBR/**' -not -path '**/*-ptBR.md' -not -path '**/ja/**' -not -path '**/.*/**') +MARKDOWN_FILES=$(find "$ROOT" -name '*.md' -not -path '**/.*/**') # Use our local dict for saved words, and use en_US for the main dict ASPELL="aspell -M --dont-save-repl -p $ROOT/util/aspell.en.pws -d en_US"