micropython-stubber 1.23.3__py3-none-any.whl → 1.24.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/METADATA +29 -11
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/RECORD +68 -65
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/WHEEL +1 -1
- mpflash/README.md +2 -2
- mpflash/mpflash/basicgit.py +22 -2
- mpflash/mpflash/common.py +23 -13
- mpflash/mpflash/downloaded.py +10 -2
- mpflash/mpflash/flash/esp.py +1 -1
- mpflash/mpflash/mpboard_id/__init__.py +9 -4
- mpflash/mpflash/mpboard_id/add_boards.py +25 -14
- mpflash/mpflash/mpboard_id/board.py +2 -2
- mpflash/mpflash/mpboard_id/board_id.py +10 -6
- mpflash/mpflash/mpboard_id/board_info.zip +0 -0
- mpflash/mpflash/mpremoteboard/__init__.py +13 -8
- mpflash/mpflash/vendor/board_database.py +185 -0
- mpflash/mpflash/vendor/readme.md +10 -1
- mpflash/mpflash/versions.py +28 -40
- mpflash/poetry.lock +1147 -231
- mpflash/pyproject.toml +4 -3
- stubber/__init__.py +1 -1
- stubber/board/createstubs.py +76 -34
- stubber/board/createstubs_db.py +34 -25
- stubber/board/createstubs_db_min.py +90 -83
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +34 -25
- stubber/board/createstubs_mem_min.py +123 -116
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +154 -145
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/modulelist.txt +16 -0
- stubber/codemod/enrich.py +301 -86
- stubber/codemod/merge_docstub.py +251 -66
- stubber/codemod/test_enrich.py +87 -0
- stubber/codemod/visitors/type_helpers.py +182 -0
- stubber/commands/build_cmd.py +16 -3
- stubber/commands/clone_cmd.py +3 -3
- stubber/commands/config_cmd.py +4 -2
- stubber/commands/enrich_folder_cmd.py +33 -21
- stubber/commands/get_core_cmd.py +1 -2
- stubber/commands/get_docstubs_cmd.py +60 -6
- stubber/commands/get_frozen_cmd.py +15 -12
- stubber/commands/get_mcu_cmd.py +3 -3
- stubber/commands/merge_cmd.py +1 -2
- stubber/commands/publish_cmd.py +19 -4
- stubber/commands/stub_cmd.py +3 -3
- stubber/commands/switch_cmd.py +3 -5
- stubber/commands/variants_cmd.py +3 -3
- stubber/cst_transformer.py +52 -17
- stubber/freeze/common.py +27 -11
- stubber/freeze/freeze_manifest_2.py +8 -1
- stubber/freeze/get_frozen.py +4 -1
- stubber/merge_config.py +111 -0
- stubber/minify.py +1 -2
- stubber/publish/database.py +51 -10
- stubber/publish/merge_docstubs.py +38 -17
- stubber/publish/package.py +32 -18
- stubber/publish/publish.py +8 -8
- stubber/publish/stubpackage.py +117 -50
- stubber/rst/lookup.py +205 -41
- stubber/rst/reader.py +106 -59
- stubber/rst/rst_utils.py +24 -11
- stubber/stubber.py +1 -1
- stubber/stubs_from_docs.py +31 -13
- stubber/update_module_list.py +2 -2
- stubber/utils/config.py +33 -13
- stubber/utils/post.py +9 -6
- stubber/publish/missing_class_methods.py +0 -51
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/entry_points.txt +0 -0
@@ -1,8 +1,7 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: micropython-stubber
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.24.1
|
4
4
|
Summary: Tooling to create and maintain stubs for MicroPython
|
5
|
-
Home-page: https://github.com/Josverl/micropython-stubber#readme
|
6
5
|
License: MIT
|
7
6
|
Keywords: MicroPython,stubs,vscode,pyright,linting,static type check
|
8
7
|
Author: Jos Verlinde
|
@@ -14,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
16
15
|
Classifier: Programming Language :: Python :: 3.12
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
18
18
|
Classifier: Programming Language :: Python :: Implementation :: MicroPython
|
19
19
|
Classifier: Topic :: Software Development :: Build Tools
|
@@ -26,27 +26,27 @@ Requires-Dist: executing (>=2.0.1,<3.0.0)
|
|
26
26
|
Requires-Dist: importlib-metadata (>=1,<9) ; python_version < "3.8"
|
27
27
|
Requires-Dist: libcst (>=1.1.0,<2.0.0)
|
28
28
|
Requires-Dist: loguru (>=0.6,<0.8)
|
29
|
-
Requires-Dist: mpflash (>=1.
|
30
|
-
Requires-Dist: mpremote (>=1.
|
31
|
-
Requires-Dist: mypy (
|
29
|
+
Requires-Dist: mpflash (>=1.24.6)
|
30
|
+
Requires-Dist: mpremote (>=1.24.1)
|
31
|
+
Requires-Dist: mypy (>=1.10)
|
32
32
|
Requires-Dist: mypy-gitlab-code-quality (>=1.1.0,<2.0.0)
|
33
|
-
Requires-Dist: packaging (>=
|
33
|
+
Requires-Dist: packaging (>=24.2,<25.0)
|
34
34
|
Requires-Dist: pipx (>=1.1.0,<2.0.0)
|
35
|
+
Requires-Dist: poetry (>=2.0.1,<3.0.0)
|
35
36
|
Requires-Dist: pygithub (>=2.1.1,<3.0.0)
|
36
37
|
Requires-Dist: pypi-simple (>=1.0.0,<2.0.0)
|
37
|
-
Requires-Dist: pyright (>=1.1.341
|
38
|
-
Requires-Dist: pyserial (>=3.5
|
39
|
-
Requires-Dist: pysondb-v2 (>=2.1.0,<3.0.0)
|
38
|
+
Requires-Dist: pyright (>=1.1.341)
|
39
|
+
Requires-Dist: pyserial (>=3.5)
|
40
40
|
Requires-Dist: python-minifier (>=2.7.0,<3.0.0) ; python_version < "3.14"
|
41
41
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
42
42
|
Requires-Dist: rich-click (>=1.8.3,<2.0.0)
|
43
|
-
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
44
43
|
Requires-Dist: tenacity (>=8.2.2,<9.0.0)
|
45
44
|
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
46
45
|
Requires-Dist: tomli-w (>=1.0.0,<2.0.0)
|
47
46
|
Requires-Dist: typed-config (>=1.3.0,<2.0.0)
|
48
47
|
Requires-Dist: urllib3 (>=2.2.2,<3.0.0)
|
49
48
|
Project-URL: Documentation, https://micropython-stubber.readthedocs.io/
|
49
|
+
Project-URL: Homepage, https://github.com/Josverl/micropython-stubber#readme
|
50
50
|
Project-URL: Repository, https://github.com/Josverl/micropython-stubber
|
51
51
|
Description-Content-Type: text/markdown
|
52
52
|
|
@@ -177,6 +177,21 @@ Both `MicroPython-Stubber` and `mpflash` are licensed under the MIT license, and
|
|
177
177
|
|
178
178
|
# Contributions
|
179
179
|
<!-- spell-checker: disable -->
|
180
|
+
<!--
|
181
|
+
To add via the cli run the following command:
|
182
|
+
npx all-contributors-cli add user things
|
183
|
+
|
184
|
+
- bug
|
185
|
+
- tool
|
186
|
+
- stubs
|
187
|
+
- test
|
188
|
+
- doc
|
189
|
+
- code
|
190
|
+
- research
|
191
|
+
- ideas
|
192
|
+
- content
|
193
|
+
- mpflash
|
194
|
+
-->
|
180
195
|
|
181
196
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
182
197
|
<!-- prettier-ignore-start -->
|
@@ -230,6 +245,9 @@ Both `MicroPython-Stubber` and `mpflash` are licensed under the MIT license, and
|
|
230
245
|
</tr>
|
231
246
|
<tr>
|
232
247
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DavesCodeMusings"><img src="https://avatars.githubusercontent.com/u/61114342?v=4?s=100" width="100px;" alt="David Horton"/><br /><sub><b>David Horton</b></sub></a><br /><a href="#mpflash-DavesCodeMusings" title="mpflash">💥</a> <a href="#test-DavesCodeMusings" title="Test">✅</a></td>
|
248
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hlovatt"><img src="https://avatars.githubusercontent.com/u/8424169?v=4?s=100" width="100px;" alt="Howard Lovatt"/><br /><sub><b>Howard Lovatt</b></sub></a><br /><a href="#stubs-hlovatt" title="MicroPython stubs">🖍️</a> <a href="#research-hlovatt" title="Research">🔬</a></td>
|
249
|
+
<td align="center" valign="top" width="14.28%"><a href="https://virtualwolf.org/"><img src="https://avatars.githubusercontent.com/u/1644623?v=4?s=100" width="100px;" alt="VirtualWolf"/><br /><sub><b>VirtualWolf</b></sub></a><br /><a href="#test-VirtualWolf" title="Test">✅</a></td>
|
250
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lukaskremla"><img src="https://avatars.githubusercontent.com/u/155779787?v=4?s=100" width="100px;" alt="Lukas Kremla"/><br /><sub><b>Lukas Kremla</b></sub></a><br /><a href="#test-lukaskremla" title="Test">✅</a></td>
|
233
251
|
</tr>
|
234
252
|
</tbody>
|
235
253
|
</table>
|
@@ -2,7 +2,7 @@ mpflash/libusb_flash.ipynb,sha256=7RGtGg1mPPMWrfJOobOfYYwAAhsFpykpTJtfNwevY9o,66
|
|
2
2
|
mpflash/mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
mpflash/mpflash/add_firmware.py,sha256=1h0HsA-EVi3HXLmoEvzwY_a-GuWYzPwulTYHHBB8THg,3428
|
4
4
|
mpflash/mpflash/ask_input.py,sha256=RJHGGrhYniSu-bdoKnKptE3DtpiCREJGRTZmFazvG-E,8946
|
5
|
-
mpflash/mpflash/basicgit.py,sha256=
|
5
|
+
mpflash/mpflash/basicgit.py,sha256=NO27JTPUsnMWQ2bKI_zsIFsFTfCZO3QKbvQ23kIehxU,10734
|
6
6
|
mpflash/mpflash/bootloader/__init__.py,sha256=Qy3E6tETPnzMga9LgD5UgOvJ0zZIBEqhtEVb4v8CTWQ,107
|
7
7
|
mpflash/mpflash/bootloader/activate.py,sha256=FlO4XQlKyoOuvmDdj_0u_mjNPhjGwB_K17jQ-8nSXRA,2361
|
8
8
|
mpflash/mpflash/bootloader/detect.py,sha256=fBrILi7-ICRaregqms3PYqwiQVAJC0rXVhpyzDkoPQI,2690
|
@@ -14,14 +14,14 @@ mpflash/mpflash/cli_flash.py,sha256=pVqEsDocDT3KmIMTpXdym-ZlzThLSIp6oVtYib65dys,
|
|
14
14
|
mpflash/mpflash/cli_group.py,sha256=VWwYHiPVV19sQEr5lL8LlcPyZ-A6Gs79eMDJy8LLt90,2615
|
15
15
|
mpflash/mpflash/cli_list.py,sha256=ja21AZ4yghGTtOHkEtV1EOmT6EYxOiU2gzJc-mZaDto,2427
|
16
16
|
mpflash/mpflash/cli_main.py,sha256=5EkvzsqOUDXvNaW814oSUcPWeNhnwh78Sg0MteDv_fk,1133
|
17
|
-
mpflash/mpflash/common.py,sha256=
|
17
|
+
mpflash/mpflash/common.py,sha256=umTouKs5Wb7Q2zOaaoO9nqmlpHIaiDBRIGYIkZMBVO8,7558
|
18
18
|
mpflash/mpflash/config.py,sha256=tdpvAvAlpco1GfeG2evn5tAKYluLEanqwrrvkir7QcQ,1073
|
19
19
|
mpflash/mpflash/connected.py,sha256=woYhuXoWpfzRMDUpBLVQZbVTGtMsKWNd5z1rsR1ELXA,3578
|
20
20
|
mpflash/mpflash/download.py,sha256=wE4uBSFFMAKOBH4jwHweL0wVYh4vi74t1673ku_IeoA,14305
|
21
|
-
mpflash/mpflash/downloaded.py,sha256=
|
21
|
+
mpflash/mpflash/downloaded.py,sha256=nxTWU4lvhcthqvVmzpYHnXCnjD8wJv0KFq2KtaoTO1A,5160
|
22
22
|
mpflash/mpflash/errors.py,sha256=IAidY3qkZsXy6Pm1rdmVFmGyg81ywHhse3itaPctA2w,247
|
23
23
|
mpflash/mpflash/flash/__init__.py,sha256=g4Fp8MiquaDZXIvRJwYRkkll1MMyRud7x6qmwCk9Lgo,2096
|
24
|
-
mpflash/mpflash/flash/esp.py,sha256=
|
24
|
+
mpflash/mpflash/flash/esp.py,sha256=CRF8sfIyuDZoYC1luBy92zLm6Qz3dnBBWjuJ3A4_crE,2284
|
25
25
|
mpflash/mpflash/flash/stm32.py,sha256=dqp9BZ4Vr-6GlQcF12TSmRf-5TXkov9qvCpMgeUJc7Y,574
|
26
26
|
mpflash/mpflash/flash/stm32_dfu.py,sha256=W-3JsRQyf3DduoIRXDmGZ35RogqtjQgcJnk-GOtQoLE,3090
|
27
27
|
mpflash/mpflash/flash/uf2/__init__.py,sha256=ucTg1pg7TruwPjecCPWYRpCwWPz-rngv7UYaQ_bMzww,2854
|
@@ -33,43 +33,44 @@ mpflash/mpflash/flash/uf2/windows.py,sha256=v89eXA3QwZxilCazi3Z--yY8UNtZ94trNEJ6
|
|
33
33
|
mpflash/mpflash/flash/worklist.py,sha256=owS3xJbWC-SzbK9z6jQER0Kat3OIV09IxnV-f-tjGlY,5998
|
34
34
|
mpflash/mpflash/list.py,sha256=lP_S5xbC0Men9HsXcIxOsP0bFRlCYh5CynMLFJx8cEE,3607
|
35
35
|
mpflash/mpflash/logger.py,sha256=dI_H_a7EOdQJyvoeRHQuYeZuTKYVUS3DUPTLhE9rkdM,1098
|
36
|
-
mpflash/mpflash/mpboard_id/__init__.py,sha256=
|
37
|
-
mpflash/mpflash/mpboard_id/add_boards.py,sha256=
|
38
|
-
mpflash/mpflash/mpboard_id/board.py,sha256=
|
39
|
-
mpflash/mpflash/mpboard_id/board_id.py,sha256=
|
40
|
-
mpflash/mpflash/mpboard_id/board_info.zip,sha256=
|
36
|
+
mpflash/mpflash/mpboard_id/__init__.py,sha256=b9PJiKFqmfyYgfi0-pbWGp2mrljdgvO6DNy0ABS8izU,3898
|
37
|
+
mpflash/mpflash/mpboard_id/add_boards.py,sha256=Bc83FctlVl4u4j0xeKTfEkuQj0WWIqxtdUF1P5RTAvY,9900
|
38
|
+
mpflash/mpflash/mpboard_id/board.py,sha256=JKb4T67HmK7widW-4c1PgilvywMbZYToLk9Fyokm-6Q,1163
|
39
|
+
mpflash/mpflash/mpboard_id/board_id.py,sha256=MnDWPqp0OqCkWD3E1Mhg-g20qASgPVHdROOCdr5TpOU,3249
|
40
|
+
mpflash/mpflash/mpboard_id/board_info.zip,sha256=DC_yHwL8A8IC0YsA2ZXjlRLZkLKiw03k4FR2HSTfBXw,21328
|
41
41
|
mpflash/mpflash/mpboard_id/store.py,sha256=n85vnUAxGKv1C23wkm22ZFAFGK6AZZiCFvc1lGJJjis,1703
|
42
|
-
mpflash/mpflash/mpremoteboard/__init__.py,sha256=
|
42
|
+
mpflash/mpflash/mpremoteboard/__init__.py,sha256=Vydc7jZai32lrGTUjwylZT9U8yulsgLIk39mnuI_k9I,9666
|
43
43
|
mpflash/mpflash/mpremoteboard/mpy_fw_info.py,sha256=eRjhqN7MpmYE9TiS4iukquZZs3QE_lD5zv_vOPSjNrk,4821
|
44
44
|
mpflash/mpflash/mpremoteboard/runner.py,sha256=-PgzAeBGbyXaAUlwyiw4mcINsP2U1XRRjP1_QdBrxpg,4786
|
45
|
+
mpflash/mpflash/vendor/board_database.py,sha256=QE3oXj96oTAsx94gNfHMYWu_RgBTHW1v9Wp5dq_Dt-Q,5253
|
45
46
|
mpflash/mpflash/vendor/click_aliases.py,sha256=c853EHSlkE2DvFqeFvFpwXKuJj3_jsXDP7iotVOKaAw,3156
|
46
47
|
mpflash/mpflash/vendor/dfu.py,sha256=ZXMcE6aH4-43Wh4tbQT4U-q-BU3RUiL3JAxmP_QAK2s,5755
|
47
48
|
mpflash/mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
|
48
|
-
mpflash/mpflash/vendor/readme.md,sha256=
|
49
|
-
mpflash/mpflash/versions.py,sha256=
|
50
|
-
mpflash/poetry.lock,sha256=
|
51
|
-
mpflash/pyproject.toml,sha256=
|
52
|
-
mpflash/README.md,sha256=
|
49
|
+
mpflash/mpflash/vendor/readme.md,sha256=KcCbOVb_-9V6Cwwd0J01Avx4LuZphe9UJ40Gs-Hocf4,327
|
50
|
+
mpflash/mpflash/versions.py,sha256=qGkE2LTzQ1QDyHc9-wzsHsRrN7PWK69xt0Vq3EVojms,4452
|
51
|
+
mpflash/poetry.lock,sha256=h9PjfKhgsKMhwVkecxegCs2A85IKJOihQMez9KEhChU,198917
|
52
|
+
mpflash/pyproject.toml,sha256=Cowj0SqNAu6Elc9WuYZiSa6QJVCNxQfiDW0ePV_d2Ak,1779
|
53
|
+
mpflash/README.md,sha256=ogIHXiV_8H4g9KiWPdb5DVih5D3-H6wihC0G1SLYB5U,16045
|
53
54
|
mpflash/stm32_udev_rules.md,sha256=uxvC8FvU7K0R1QQUqCIvVfW9yfWYlIHhIVtirAjQVHE,2684
|
54
|
-
stubber/__init__.py,sha256=
|
55
|
+
stubber/__init__.py,sha256=4nWBb6MXbNFcvjay3e-iWpKCCrPXSMBb6DEARyFVfOw,49
|
55
56
|
stubber/board/board_info.csv,sha256=K2VSmfR013fN-oJWkQUmiQ19w09dVwJHDquPy6QmMhY,8627
|
56
57
|
stubber/board/boot.py,sha256=XjWlKErU5nI1HJSugXIP_3hlwgRQboE6sJrpcbSygnk,1120
|
57
|
-
stubber/board/createstubs.py,sha256=
|
58
|
-
stubber/board/createstubs_db.py,sha256=
|
59
|
-
stubber/board/createstubs_db_min.py,sha256=
|
60
|
-
stubber/board/createstubs_db_mpy.mpy,sha256=
|
58
|
+
stubber/board/createstubs.py,sha256=h4S7Ng8bdK6jTH8E53T9b08whCPOwaHKb8t9aRYIz4U,34022
|
59
|
+
stubber/board/createstubs_db.py,sha256=Vo7lEctHVBAHtjj9NM3VrU0dA5CahcsDoEnoc6C5Cw8,30821
|
60
|
+
stubber/board/createstubs_db_min.py,sha256=_dVETGA9aGBy209AUnKchbV4FNjlXhaBqR4hSVgQ7t0,11754
|
61
|
+
stubber/board/createstubs_db_mpy.mpy,sha256=VEYnF75gUFpBpbdrRKC2hiIBlgf7_oUZy0mKGIbWv2I,9801
|
61
62
|
stubber/board/createstubs_lvgl.py,sha256=CTe7eq1ACRK_JJxavaqDD8znn29nSWJiHHTZ_ps6EhM,27217
|
62
63
|
stubber/board/createstubs_lvgl_min.py,sha256=jLkWYmeboI2A8feMC7pT7cYWttLejQTuX7WAEZCylhw,27207
|
63
64
|
stubber/board/createstubs_lvgl_mpy.mpy,sha256=ex-nlq2V5e8anQBJvRWEEc-FzU7nlwg5NSrZ8vOadIA,9267
|
64
|
-
stubber/board/createstubs_mem.py,sha256=
|
65
|
-
stubber/board/createstubs_mem_min.py,sha256=
|
66
|
-
stubber/board/createstubs_mem_mpy.mpy,sha256=
|
67
|
-
stubber/board/createstubs_min.py,sha256=
|
68
|
-
stubber/board/createstubs_mpy.mpy,sha256=
|
65
|
+
stubber/board/createstubs_mem.py,sha256=2-K0inLm3niauu7se9RptYYfba4XDteJhNydj06tTXs,29157
|
66
|
+
stubber/board/createstubs_mem_min.py,sha256=jXiAsirAJLBjCt5n5pHoGTgDDMPUQoxeIyulWxW-3ZY,11300
|
67
|
+
stubber/board/createstubs_mem_mpy.mpy,sha256=sU_Jd0AYhoOv6iq3z9hED0cjXCzcNzV0ZkLKV_JfEQE,9380
|
68
|
+
stubber/board/createstubs_min.py,sha256=oluEUcUvjV22Lb91foK3osa4A-LZZuvotQQE8qm-d5U,14132
|
69
|
+
stubber/board/createstubs_mpy.mpy,sha256=BTF2FWCuMZJGyzCjIgtbZmCJgLK7TRytUOCm6cK4YIE,12832
|
69
70
|
stubber/board/fw_info.py,sha256=6AQbN3jtQgllqWQYl4e-63KeEtV08EXk8_JnM6XBkvo,4554
|
70
71
|
stubber/board/info.py,sha256=b7SOPZHVsVhaayKCwVkFZlYu0BW-UFI7LuG1Eop9480,5629
|
71
72
|
stubber/board/main.py,sha256=f6V3tdt6sPZVLuwemT-NLuK9GySfW2c2J6PJMOOWQQw,413
|
72
|
-
stubber/board/modulelist.txt,sha256=
|
73
|
+
stubber/board/modulelist.txt,sha256=zSWH7b9Tgy3f8NBmJddI0cwvlNsAty_opGNQM6OfQZM,3037
|
73
74
|
stubber/board/pyrightconfig.json,sha256=6oHS4aDOfwKBAFeUPsCGJzEXpUgBZsPaF0M4P-N26D4,1376
|
74
75
|
stubber/bulk/mcu_stubber.py,sha256=_DLUf0SlYZRIAPRsHInIbQYwTmWF9U9-nFfWQ9D3k3w,15731
|
75
76
|
stubber/codemod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -80,26 +81,28 @@ stubber/codemod/_partials/modules_reader.py,sha256=dJj-H0ncUWVtilSyohQ-dyiUZOjQO
|
|
80
81
|
stubber/codemod/add_comment.py,sha256=CZMjtKO9aarZo1E60QXo80CLJAH05z_ylK6Vvjvb0ls,1965
|
81
82
|
stubber/codemod/add_method.py,sha256=fZH-RGi_pzFpi3tF_0AMDbA9A94dlgXMrc3ItpY3Ylw,2609
|
82
83
|
stubber/codemod/board.py,sha256=HDNS8saQIdoPH74MNG9mte0MRBqCOcy3d6f_I0H9J2I,11881
|
83
|
-
stubber/codemod/enrich.py,sha256=
|
84
|
-
stubber/codemod/merge_docstub.py,sha256=
|
84
|
+
stubber/codemod/enrich.py,sha256=mrnhPLgjYQZvxaeMPAcZ_459-XC5rw_SAKsFxLtlMYo,12788
|
85
|
+
stubber/codemod/merge_docstub.py,sha256=fgi0PVRhN9gGzcOfCUW0ni-C54oGYUKwc5Yk2FsCS3U,22081
|
85
86
|
stubber/codemod/modify_list.py,sha256=xrpFBKug273D9E02owUheZD418BvsIHIZCFj4YDjTxU,2118
|
87
|
+
stubber/codemod/test_enrich.py,sha256=ckJtwo4PsXckcnZGk_2gxRRLQkfKI650pVmdByw_pVo,2820
|
86
88
|
stubber/codemod/utils.py,sha256=3hk7pwyS4KZxewrWLwbOrdA5ympbum-kfL0ZN-M7rlo,2459
|
89
|
+
stubber/codemod/visitors/type_helpers.py,sha256=FBV6wwPtBiWwZTqEpdhVw-Jghi-gxyMVZE4SyGn7uRU,6812
|
87
90
|
stubber/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
88
|
-
stubber/commands/build_cmd.py,sha256=
|
91
|
+
stubber/commands/build_cmd.py,sha256=Zseci4EHxJuiiy7YS-ucmMokDrVLe4j6fPs-PSbwq1k,2813
|
89
92
|
stubber/commands/cli.py,sha256=HY4CqB0PPTmzew2sABNsHeNKDPblcGzzbmvtF46oVsU,1556
|
90
|
-
stubber/commands/clone_cmd.py,sha256=
|
91
|
-
stubber/commands/config_cmd.py,sha256=
|
92
|
-
stubber/commands/enrich_folder_cmd.py,sha256=
|
93
|
-
stubber/commands/get_core_cmd.py,sha256=
|
94
|
-
stubber/commands/get_docstubs_cmd.py,sha256=
|
95
|
-
stubber/commands/get_frozen_cmd.py,sha256=
|
96
|
-
stubber/commands/get_mcu_cmd.py,sha256=
|
97
|
-
stubber/commands/merge_cmd.py,sha256=
|
98
|
-
stubber/commands/publish_cmd.py,sha256=
|
99
|
-
stubber/commands/stub_cmd.py,sha256=
|
100
|
-
stubber/commands/switch_cmd.py,sha256=
|
101
|
-
stubber/commands/variants_cmd.py,sha256=
|
102
|
-
stubber/cst_transformer.py,sha256=
|
93
|
+
stubber/commands/clone_cmd.py,sha256=QyKnU3calhVx-rhlfzbeZbqgBFFTzfoYeKHNH9qmfgM,2781
|
94
|
+
stubber/commands/config_cmd.py,sha256=e8heX27MXfazLxMVtgjK4dsLCWhsoCfdeYGVoH3rqtA,1211
|
95
|
+
stubber/commands/enrich_folder_cmd.py,sha256=UfJFYdxmGVN0Bcu2Jb_Q36BiX5kzzK-bvfz26zq1eG4,2276
|
96
|
+
stubber/commands/get_core_cmd.py,sha256=Ua_10gdwOX9ceHY4SLV36esdTWbCwGtQ593A-qR_pgg,2323
|
97
|
+
stubber/commands/get_docstubs_cmd.py,sha256=KFbuRgoLtBa_aPE3vp1WJypQ1lGrL3nA9kUpFa-_2Jk,4723
|
98
|
+
stubber/commands/get_frozen_cmd.py,sha256=lhR6ylm_GL8VdXklN8T0liMtUK3nr1Xx7v8qsnxea6w,4216
|
99
|
+
stubber/commands/get_mcu_cmd.py,sha256=CTQVIoGqBx6gwUp1aH1gOysVFEZbeqMvpPb2WJA4EVQ,2807
|
100
|
+
stubber/commands/merge_cmd.py,sha256=Iy_gwW35Ob6G_W9nMLT4rHyZXknT_YvypHd3owH93QI,1683
|
101
|
+
stubber/commands/publish_cmd.py,sha256=eo052T3k0YW6m0gJJ3hoZbchd0whMr74z3MudHKthIQ,3275
|
102
|
+
stubber/commands/stub_cmd.py,sha256=eqhZJ2cyt1-jPxSaywUP8Sn4hPbdCnMQp5TSnZji6gk,1216
|
103
|
+
stubber/commands/switch_cmd.py,sha256=yeK9rNkIl8WicheUGHnK5u7YrV5iR1KBEILVUfbOQtA,1866
|
104
|
+
stubber/commands/variants_cmd.py,sha256=Q7DjPElEfSHhDxAlvtiGHWv9e47QPSLYMIs0ScfI7AA,1296
|
105
|
+
stubber/cst_transformer.py,sha256=xcarTUQMrC0x4InFEgixWvfvA9hEupiw_AUfPFXPxS4,7997
|
103
106
|
stubber/data/board_info.csv,sha256=K2VSmfR013fN-oJWkQUmiQ19w09dVwJHDquPy6QmMhY,8627
|
104
107
|
stubber/data/board_info.json,sha256=jyvBN5seoxx7Z7B3UpvMn7H8xWCpmG4VtFSPb8PjmZI,58939
|
105
108
|
stubber/data/micropython_tags.csv,sha256=HQnzPN7jLmgKX3QvobsPMZa-xMb0exglriFziBjaRz8,1909
|
@@ -107,52 +110,52 @@ stubber/data/requirements-core-micropython.txt,sha256=6RQWWbLh8YVcD_l1-hjg6wX_Fm
|
|
107
110
|
stubber/data/requirements-core-pycopy.txt,sha256=tW71l6FIuoQY1tuxkDgeN4Uw8IIp0YrlhhaaqSGSOA8,1051
|
108
111
|
stubber/downloader.py,sha256=L0ZgXv-0JfPgPpzDqP66q8Guu0QiN_vgWuB_t_lKmRA,1206
|
109
112
|
stubber/freeze/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
110
|
-
stubber/freeze/common.py,sha256=
|
113
|
+
stubber/freeze/common.py,sha256=GA8DaEBsWLTNvVCWZMmtI9i9Ih5aVzK5DfNWMoCbFa4,3306
|
111
114
|
stubber/freeze/freeze_folder.py,sha256=49rSh6LHbVweDM6QCoe8Pku0gyEOzz7nOtaivyJ56LE,2490
|
112
|
-
stubber/freeze/freeze_manifest_2.py,sha256=
|
113
|
-
stubber/freeze/get_frozen.py,sha256=
|
115
|
+
stubber/freeze/freeze_manifest_2.py,sha256=BNjjw30WhdI8I_L3rBRRGyoCDCk8O3-MZcM0AScSZBI,4455
|
116
|
+
stubber/freeze/get_frozen.py,sha256=ojxUO-Fiy-Tn49Tv_puQrBtZ0dxQEmWj2HfWmHmGODQ,5355
|
114
117
|
stubber/get_cpython.py,sha256=Qnug4TlytwrqBRXCNGnRIMGW63zVcQL_8Ua93eTbrc8,3885
|
115
118
|
stubber/get_lobo.py,sha256=jyysWbeEwNuZZtkTudJP1QbyVvh-TwFom5cE7iCi9lE,1776
|
116
|
-
stubber/
|
119
|
+
stubber/merge_config.py,sha256=9utehqu0X8CHKKrNdDrfQU3U-zD6a8SGx27bGtI8uqs,3829
|
120
|
+
stubber/minify.py,sha256=DBVwAJdzEA0Xkx5ZJlyCdFgQuxYeM62GZqtdEd1sAUU,15084
|
117
121
|
stubber/publish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
118
122
|
stubber/publish/bump.py,sha256=qSb1DpaIxgyoH3YcPU1XKyDKgqkomxSm0WWf1sAVh0Y,3262
|
119
123
|
stubber/publish/candidates.py,sha256=w_OzjVU9euaWGf1lC3p5FuwpP1YDXjjGoczFE41QAik,10820
|
120
|
-
stubber/publish/database.py,sha256=
|
124
|
+
stubber/publish/database.py,sha256=8wCr19i_6x00spvHlfzlz5nRcfhTgEPeNUnHHRZ967Q,1851
|
121
125
|
stubber/publish/defaults.py,sha256=naAyHN_k8OFQfqRnXlPU3HNA0IZll-NA5GuJEvDEG_k,1532
|
122
126
|
stubber/publish/enums.py,sha256=Z_x798ArtxyjQIRRY43GDGNB9BD4uPfpeGsXYdj31w0,780
|
123
127
|
stubber/publish/helpers.py,sha256=909umfKUHBMBoVnAanop1vKx8loCrWntlfiiG6z89lY,716
|
124
|
-
stubber/publish/merge_docstubs.py,sha256
|
125
|
-
stubber/publish/
|
126
|
-
stubber/publish/package.py,sha256=-6Q4cBzISAHngHXDloLzVMSC2qTCCuMH_Xa9hSYRi0E,5290
|
128
|
+
stubber/publish/merge_docstubs.py,sha256=-E8wkTDgeFzpxQNiiuzSpQ50HrjP_jaf2QfRbnn50Po,5825
|
129
|
+
stubber/publish/package.py,sha256=XbPRw5aTgS53ptPmSpGlEsiIGHKWloG2-cgN2PxSaw8,5374
|
127
130
|
stubber/publish/pathnames.py,sha256=vORgygaOJJAjlI3cLhNTHfowdewSDsv7zck5evPe1cY,1803
|
128
|
-
stubber/publish/publish.py,sha256=
|
131
|
+
stubber/publish/publish.py,sha256=fG95ANcdZibwWW_ZoqjhPpolswb17IOi-gTIpNPwjKc,3989
|
129
132
|
stubber/publish/pypi.py,sha256=LdvwLfjkkSFBTI4MHyl7Ko_ZWn1SflWxJ9uo2mtPKtc,1272
|
130
|
-
stubber/publish/stubpackage.py,sha256=
|
133
|
+
stubber/publish/stubpackage.py,sha256=J0c3H2ZRoqaol63V1ZA3RXtpSXq8oUtkNJ0nqsOnvOg,47647
|
131
134
|
stubber/rst/__init__.py,sha256=5VcbDCotIICa2xnJDs_gw2sFXpjjGOZZbwCrNKXy1OE,293
|
132
135
|
stubber/rst/classsort.py,sha256=-Uji6LzBbX6voKmiXSuexJXyoQ3fmSDQ7Fuz4j1Kk8E,2655
|
133
|
-
stubber/rst/lookup.py,sha256=
|
136
|
+
stubber/rst/lookup.py,sha256=qrFdxMiG7D3iC9ECrJ0JKYKL-tDRbMIFnlJrHi1hEXU,26169
|
134
137
|
stubber/rst/output_dict.py,sha256=cpBXRtUD-uh0EgjWIBiRrMLBmIAEXjoJFSOAg-qJQiU,14755
|
135
|
-
stubber/rst/reader.py,sha256=
|
138
|
+
stubber/rst/reader.py,sha256=CEPtp_9fmYqAtKMFdyW0UgPMshuNFfqRyU2K6jRnvhs,35197
|
136
139
|
stubber/rst/report_return.py,sha256=p0JfJs_WTWTtRZREcQeqUgDW-_TP2VuuX7k7-c49y5E,3024
|
137
|
-
stubber/rst/rst_utils.py,sha256
|
138
|
-
stubber/stubber.py,sha256=
|
139
|
-
stubber/stubs_from_docs.py,sha256=
|
140
|
+
stubber/rst/rst_utils.py,sha256=-F6J09-WQBzI5419ItzOlm4gUKxF4BMru2OyXx-M6ko,18314
|
141
|
+
stubber/stubber.py,sha256=GxLfHIzDyfFvgiTqMj9DB3tq7I3EnEUNbdoCtYr8gHM,1640
|
142
|
+
stubber/stubs_from_docs.py,sha256=pYrw8gkXbDcOtmrJnxEuzxrLmMWzclrDJEeszKPEZnU,3535
|
140
143
|
stubber/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
141
144
|
stubber/tools/manifestfile.py,sha256=j8ug2gtM52j-eMORLszSyqUPdcfRUrhdaaFIGSbLnaM,25751
|
142
145
|
stubber/tools/readme.md,sha256=uI0higcFUtjSLKobn7NK2LoqZ0BqcbftXSDgNjbsnzo,284
|
143
146
|
stubber/update_fallback.py,sha256=mFxFvcLWl-5IX9BdRuo_WMa538Wtomo2sE14jKbW7-0,4913
|
144
|
-
stubber/update_module_list.py,sha256=
|
147
|
+
stubber/update_module_list.py,sha256=OEAOnFxB8Ywakw0pxiiTrIplWmoJ9r3Cdn07EpVDmNY,4038
|
145
148
|
stubber/utils/__init__.py,sha256=73LiuTInDABhDhnDixU8ojlkVUjR5e3Uv8QNaeBMG0E,234
|
146
|
-
stubber/utils/config.py,sha256=
|
149
|
+
stubber/utils/config.py,sha256=wPmSSut9PWjLFzr_8jj7IwkrVsL4mq17X8DGOeRqXGw,5544
|
147
150
|
stubber/utils/makeversionhdr.py,sha256=dO8sWLAY_ifT1IJJ1-JJ2z_thvfqJnK3c1_bHF_UI28,1953
|
148
151
|
stubber/utils/manifest.py,sha256=KEeFwVCke2XlUv8-g9S10DaoHzISZDxZn0G4LrHn2vA,3239
|
149
|
-
stubber/utils/post.py,sha256=
|
152
|
+
stubber/utils/post.py,sha256=lHGPO_q-ZQgx03P0vEwZDVr0pCNt5-gY-DXW62DBeQM,2926
|
150
153
|
stubber/utils/repos.py,sha256=piUZwtHBXXJ-XPhvw_qXYqO-fy1ktZsb9-7CAwNo2YQ,5896
|
151
154
|
stubber/utils/stubmaker.py,sha256=pO8Bo9JuHo6eeJGJz4hO2PzVJojNYFdJPdVtlgjKkBI,5236
|
152
155
|
stubber/utils/typed_config_toml.py,sha256=ZR7eo-whyL4nhFXj6xs7E121sLuE-ivlUDevII4K2xg,2653
|
153
156
|
stubber/variants.py,sha256=NnwUP-aiGUPAn15BeRRFcBWQUOzAFFnN2oL4u9zio-s,3792
|
154
|
-
micropython_stubber-1.
|
155
|
-
micropython_stubber-1.
|
156
|
-
micropython_stubber-1.
|
157
|
-
micropython_stubber-1.
|
158
|
-
micropython_stubber-1.
|
157
|
+
micropython_stubber-1.24.1.dist-info/entry_points.txt,sha256=JoR8NWh8t6pbDyn0WOMCIfRfDQAOGxqbOgJWuxv3Cxw,116
|
158
|
+
micropython_stubber-1.24.1.dist-info/LICENSE,sha256=Fx9qrL45ayRXgH6QzttboqZEjKXms0w1t_b_nkOqYCU,1572
|
159
|
+
micropython_stubber-1.24.1.dist-info/METADATA,sha256=6Gnlh9EeIuyneLSALgsqwbQFFeQxhvM1cjrOyza-vHs,25020
|
160
|
+
micropython_stubber-1.24.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
161
|
+
micropython_stubber-1.24.1.dist-info/RECORD,,
|
mpflash/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
This tool was initially created to be used in a CI/CD pipeline to automate the process of downloading and flashing MicroPython firmware to multiple boards, but it has been extend with a TUI to be used for manual downloadig, flashing and development.
|
10
10
|
|
11
11
|
`mpflash` has been tested on:
|
12
|
-
- OS: Windows x64, Linux X64,
|
12
|
+
- OS: Windows x64, Linux X64, and macOS.
|
13
13
|
- Micropython (hardware) ports:
|
14
14
|
- `rp2`, using `.uf2`, using filecopy
|
15
15
|
- `samd`, using ` .uf2`, using filecopy
|
@@ -17,7 +17,7 @@ This tool was initially created to be used in a CI/CD pipeline to automate the p
|
|
17
17
|
- `esp8266`, using `.bin`, using esptool
|
18
18
|
- `stm32`, using ` .dfu`, using pydfu
|
19
19
|
|
20
|
-
Not yet implemented: `nrf`, `cc3200`, `mimxrt`
|
20
|
+
Not yet implemented: `nrf`, `cc3200`, `mimxrt`, `renesas`
|
21
21
|
|
22
22
|
## Features
|
23
23
|
1. List the connected boards including their firmware details, in a tabular or json format
|
mpflash/mpflash/basicgit.py
CHANGED
@@ -136,6 +136,9 @@ def get_local_tags(repo: Optional[Path] = None, minver: Optional[str] = None) ->
|
|
136
136
|
return sorted(tags)
|
137
137
|
|
138
138
|
|
139
|
+
from github.GithubException import BadCredentialsException
|
140
|
+
|
141
|
+
|
139
142
|
@cachetools.func.ttl_cache(maxsize=16, ttl=60) # 60 seconds
|
140
143
|
def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
|
141
144
|
"""
|
@@ -176,7 +179,7 @@ def checkout_tag(tag: str, repo: Optional[Union[str, Path]] = None) -> bool:
|
|
176
179
|
return True
|
177
180
|
|
178
181
|
|
179
|
-
def sync_submodules(repo:
|
182
|
+
def sync_submodules(repo: Union[Path, str]) -> bool:
|
180
183
|
"""
|
181
184
|
make sure any submodules are in sync
|
182
185
|
"""
|
@@ -191,9 +194,26 @@ def sync_submodules(repo: Optional[Union[Path, str]] = None) -> bool:
|
|
191
194
|
log.debug(result.stderr)
|
192
195
|
else:
|
193
196
|
return False
|
197
|
+
checkout_arduino_lib(Path(repo))
|
194
198
|
return True
|
195
199
|
|
196
200
|
|
201
|
+
def checkout_arduino_lib(mpy_path: Path):
|
202
|
+
"""
|
203
|
+
Checkout the arduino-lib submodule repo if it exists
|
204
|
+
|
205
|
+
This is needed as some of the arduino boards freeze modules originationg from the arduino-lib
|
206
|
+
"""
|
207
|
+
# arduino_lib_path = mpy_path / "lib/arduino-lib"
|
208
|
+
if (mpy_path / "lib/arduino-lib").exists():
|
209
|
+
cmd = ["git", "submodule", "update", "--init", "lib/arduino-lib"]
|
210
|
+
try:
|
211
|
+
result = subprocess.run(cmd, cwd=mpy_path, check=True)
|
212
|
+
log.info(f"checkout arduino-lib: {result.returncode}")
|
213
|
+
except subprocess.CalledProcessError as e:
|
214
|
+
log.warning("Could not check out arduino-lib, error: ", e)
|
215
|
+
|
216
|
+
|
197
217
|
def checkout_commit(commit_hash: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
198
218
|
"""
|
199
219
|
Checkout a specific commit
|
@@ -242,7 +262,7 @@ def switch_branch(branch: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
|
242
262
|
|
243
263
|
def fetch(repo: Union[Path, str]) -> bool:
|
244
264
|
"""
|
245
|
-
fetches a repo
|
265
|
+
fetches a repo and all tags
|
246
266
|
repo should be in the form of : path/.git
|
247
267
|
repo = '../micropython/.git'
|
248
268
|
returns True on success
|
mpflash/mpflash/common.py
CHANGED
@@ -2,16 +2,16 @@ import fnmatch
|
|
2
2
|
import glob
|
3
3
|
import os
|
4
4
|
import platform
|
5
|
-
import sys
|
6
5
|
from dataclasses import dataclass, field
|
7
6
|
from enum import Enum
|
8
7
|
from pathlib import Path
|
9
8
|
from typing import List, Optional, Union
|
10
9
|
|
11
|
-
from github import Auth, Github
|
12
10
|
from serial.tools import list_ports
|
13
11
|
from serial.tools.list_ports_common import ListPortInfo
|
14
12
|
|
13
|
+
from mpflash.basicgit import GH_CLIENT as GH_CLIENT
|
14
|
+
|
15
15
|
from .logger import log
|
16
16
|
|
17
17
|
# from mpflash.mpremoteboard import MPRemoteBoard
|
@@ -28,13 +28,6 @@ PORT_FWTYPES = {
|
|
28
28
|
"renesas-ra": [".hex"],
|
29
29
|
}
|
30
30
|
|
31
|
-
# Token with no permissions to avoid throttling
|
32
|
-
# https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
|
33
|
-
PAT_NO_ACCESS = "github_pat_"+"11AAHPVFQ0G4NTaQ73Bw5J"+"_fAp7K9sZ1qL8VFnI9g78eUlCdmOXHB3WzSdj2jtEYb4XF3N7PDJBl32qIxq"
|
34
|
-
|
35
|
-
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
36
|
-
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
37
|
-
|
38
31
|
|
39
32
|
@dataclass
|
40
33
|
class FWInfo:
|
@@ -135,12 +128,24 @@ def filtered_comports(
|
|
135
128
|
elif not isinstance(include, list): # type: ignore
|
136
129
|
include = list(include)
|
137
130
|
|
131
|
+
if ignore == [] and platform.system() == "Darwin":
|
132
|
+
# By default ignore some of the irrelevant ports on macOS
|
133
|
+
ignore = [
|
134
|
+
"/dev/*.debug-console",
|
135
|
+
]
|
136
|
+
|
138
137
|
# remove ports that are to be ignored
|
139
138
|
log.trace(f"{include=}, {ignore=}, {bluetooth=}")
|
140
139
|
|
141
140
|
comports = [
|
142
141
|
p for p in list_ports.comports() if not any(fnmatch.fnmatch(p.device, i) for i in ignore)
|
143
142
|
]
|
143
|
+
|
144
|
+
if False:
|
145
|
+
import jsons
|
146
|
+
|
147
|
+
print(jsons.dumps(comports).replace('{"description":', '\n{"description":'))
|
148
|
+
|
144
149
|
if platform.system() == "Linux":
|
145
150
|
# use p.location to filter out the bogus ports on newer Linux kernels
|
146
151
|
# filter out the bogus ports on newer Linux kernels
|
@@ -161,16 +166,21 @@ def filtered_comports(
|
|
161
166
|
else:
|
162
167
|
# if there are ports to ignore, add the explicit list to the filtered list
|
163
168
|
comports = list(set(explicit) | set(comports))
|
169
|
+
if platform.system() == "Darwin":
|
170
|
+
# Failsafe: filter out debug-console ports
|
171
|
+
comports = [p for p in comports if not p.description.endswith(".debug-console")]
|
172
|
+
|
164
173
|
if not bluetooth:
|
165
174
|
# filter out bluetooth ports
|
166
175
|
comports = [p for p in comports if "bluetooth" not in p.description.lower()]
|
167
176
|
comports = [p for p in comports if "BTHENUM" not in p.hwid]
|
168
|
-
if
|
177
|
+
if platform.system() == "Darwin":
|
169
178
|
comports = [p for p in comports if ".Bluetooth" not in p.device]
|
170
|
-
|
179
|
+
# filter out ports with no hwid
|
180
|
+
comports = [p for p in comports if p.hwid != "n/a"]
|
171
181
|
log.debug(f"filtered_comports: {[p.device for p in comports]}")
|
172
182
|
# sort
|
173
|
-
if
|
183
|
+
if platform.system() == "Windows":
|
174
184
|
# Windows sort of comports by number - but fallback to device name
|
175
185
|
return sorted(
|
176
186
|
comports,
|
@@ -184,7 +194,7 @@ def find_serial_by_path(target_port: str):
|
|
184
194
|
"""Find the symbolic link path of a serial port by its device path."""
|
185
195
|
# sourcery skip: use-next
|
186
196
|
|
187
|
-
if
|
197
|
+
if platform.system() == "Windows":
|
188
198
|
return None
|
189
199
|
# List all available serial ports
|
190
200
|
available_ports = list_ports.comports()
|
mpflash/mpflash/downloaded.py
CHANGED
@@ -14,11 +14,15 @@ from .config import config
|
|
14
14
|
def downloaded_firmwares(fw_folder: Path) -> List[FWInfo]:
|
15
15
|
"""Load a list of locally downloaded firmwares from the jsonl file"""
|
16
16
|
firmwares: List[FWInfo] = []
|
17
|
+
log.debug(f"Reading {fw_folder / 'firmware.jsonl' }")
|
17
18
|
try:
|
18
19
|
with jsonlines.open(fw_folder / "firmware.jsonl") as reader:
|
19
20
|
firmwares = [FWInfo.from_dict(item) for item in reader]
|
20
21
|
except FileNotFoundError:
|
21
22
|
log.error(f"No firmware.jsonl found in {fw_folder}")
|
23
|
+
except jsonlines.InvalidLineError as e:
|
24
|
+
log.error(f"Invalid firmware.jsonl found in {fw_folder} : {e}")
|
25
|
+
|
22
26
|
# sort by filename
|
23
27
|
firmwares.sort(key=lambda x: x.filename)
|
24
28
|
return firmwares
|
@@ -109,7 +113,11 @@ def filter_downloaded_fwlist(
|
|
109
113
|
log.trace(f"Filtering firmware for {version} : {len(fw_list)} found.")
|
110
114
|
# filter by port
|
111
115
|
if port:
|
112
|
-
fw_list = [
|
116
|
+
fw_list = [
|
117
|
+
fw
|
118
|
+
for fw in fw_list
|
119
|
+
if fw.port == port and Path(fw.firmware).suffix in PORT_FWTYPES[port]
|
120
|
+
]
|
113
121
|
log.trace(f"Filtering firmware for {port} : {len(fw_list)} found.")
|
114
122
|
|
115
123
|
if board_id:
|
@@ -120,7 +128,7 @@ def filter_downloaded_fwlist(
|
|
120
128
|
# the firmware variant should match exactly the board_id
|
121
129
|
fw_list = [fw for fw in fw_list if fw.variant == board_id]
|
122
130
|
log.trace(f"Filtering firmware for {board_id} : {len(fw_list)} found.")
|
123
|
-
|
131
|
+
|
124
132
|
if selector and port in selector:
|
125
133
|
fw_list = [fw for fw in fw_list if fw.filename.endswith(selector[port])]
|
126
134
|
return fw_list
|
mpflash/mpflash/flash/esp.py
CHANGED
@@ -15,7 +15,7 @@ from mpflash.mpremoteboard import MPRemoteBoard
|
|
15
15
|
|
16
16
|
|
17
17
|
def flash_esp(mcu: MPRemoteBoard, fw_file: Path, *, erase: bool = True) -> Optional[MPRemoteBoard]:
|
18
|
-
if mcu.port not in ["esp32", "esp8266"] or mcu.board
|
18
|
+
if mcu.port not in ["esp32", "esp8266"] or mcu.board.startswith("ARDUINO_"):
|
19
19
|
log.error(f"esptool not supported for {mcu.port} {mcu.board} on {mcu.serialport}")
|
20
20
|
return None
|
21
21
|
|
@@ -24,7 +24,9 @@ def get_known_ports() -> List[str]:
|
|
24
24
|
return sorted(list(ports))
|
25
25
|
|
26
26
|
|
27
|
-
def get_known_boards_for_port(
|
27
|
+
def get_known_boards_for_port(
|
28
|
+
port: Optional[str] = "", versions: Optional[List[str]] = None
|
29
|
+
) -> List[Board]:
|
28
30
|
"""
|
29
31
|
Returns a list of boards for the given port and version(s)
|
30
32
|
|
@@ -77,13 +79,16 @@ def known_stored_boards(port: str, versions: Optional[List[str]] = None) -> List
|
|
77
79
|
@lru_cache(maxsize=20)
|
78
80
|
def find_known_board(board_id: str) -> Board:
|
79
81
|
"""Find the board for the given BOARD_ID or 'board description' and return the board info as a Board object"""
|
80
|
-
#
|
82
|
+
# Some functional overlap with:
|
81
83
|
# mpboard_id\board_id.py _find_board_id_by_description
|
82
84
|
info = read_known_boardinfo()
|
83
85
|
for board_info in info:
|
84
|
-
if board_id in (
|
86
|
+
if board_id in (
|
87
|
+
board_info.board_id,
|
88
|
+
board_info.description,
|
89
|
+
) or board_info.description.startswith(board_id):
|
85
90
|
if not board_info.cpu:
|
86
|
-
#
|
91
|
+
# failsafe for older board_info.json files
|
87
92
|
print(f"Board {board_id} has no CPU info, using port as CPU")
|
88
93
|
if " with " in board_info.description:
|
89
94
|
board_info.cpu = board_info.description.split(" with ")[-1]
|