micropython-stubber 1.23.2__py3-none-any.whl → 1.24.0__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.2.dist-info → micropython_stubber-1.24.0.dist-info}/METADATA +30 -12
- {micropython_stubber-1.23.2.dist-info → micropython_stubber-1.24.0.dist-info}/RECORD +69 -66
- {micropython_stubber-1.23.2.dist-info → micropython_stubber-1.24.0.dist-info}/WHEEL +1 -1
- mpflash/README.md +2 -2
- mpflash/mpflash/basicgit.py +49 -9
- mpflash/mpflash/common.py +23 -16
- mpflash/mpflash/downloaded.py +10 -2
- 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/mpboard_id/store.py +8 -3
- mpflash/mpflash/mpremoteboard/__init__.py +13 -8
- mpflash/mpflash/mpremoteboard/mpy_fw_info.py +27 -16
- mpflash/mpflash/vendor/board_database.py +185 -0
- mpflash/mpflash/vendor/readme.md +10 -1
- mpflash/mpflash/versions.py +28 -40
- mpflash/poetry.lock +1605 -601
- mpflash/pyproject.toml +4 -3
- stubber/__init__.py +1 -1
- stubber/board/createstubs.py +51 -27
- stubber/board/createstubs_db.py +36 -28
- stubber/board/createstubs_db_min.py +171 -165
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +36 -28
- stubber/board/createstubs_mem_min.py +184 -178
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +102 -94
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/modulelist.txt +16 -0
- stubber/codemod/enrich.py +297 -88
- stubber/codemod/merge_docstub.py +250 -65
- stubber/codemod/test_enrich.py +87 -0
- stubber/codemod/visitors/typevars.py +200 -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 +33 -16
- stubber/publish/package.py +32 -18
- stubber/publish/publish.py +8 -8
- stubber/publish/stubpackage.py +110 -47
- stubber/rst/lookup.py +205 -43
- 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.2.dist-info → micropython_stubber-1.24.0.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.23.2.dist-info → micropython_stubber-1.24.0.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.0
|
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:
|
40
|
-
Requires-Dist: python-minifier (>=2.7.0,<3.0.0) ; python_version < "3.12"
|
38
|
+
Requires-Dist: pyright (>=1.1.341)
|
39
|
+
Requires-Dist: pyserial (>=3.5)
|
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,11 +14,11 @@ 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
24
|
mpflash/mpflash/flash/esp.py,sha256=_VfbyYIEaUgAjsD66tjbdgYL6ElkSAfpIMKz6q4QKig,2287
|
@@ -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=
|
41
|
-
mpflash/mpflash/mpboard_id/store.py,sha256=
|
42
|
-
mpflash/mpflash/mpremoteboard/__init__.py,sha256=
|
43
|
-
mpflash/mpflash/mpremoteboard/mpy_fw_info.py,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
|
+
mpflash/mpflash/mpboard_id/store.py,sha256=n85vnUAxGKv1C23wkm22ZFAFGK6AZZiCFvc1lGJJjis,1703
|
42
|
+
mpflash/mpflash/mpremoteboard/__init__.py,sha256=Vydc7jZai32lrGTUjwylZT9U8yulsgLIk39mnuI_k9I,9666
|
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=HapJGu4UMYe8SiO5qHxgfOsXYw7caATRgvsJwgX9Fag,22057
|
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/typevars.py,sha256=ZLLp6Fyw8jx56Uhhx1sunpUPasN8tJoaCFCugvU7z6c,7448
|
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.0.dist-info/entry_points.txt,sha256=JoR8NWh8t6pbDyn0WOMCIfRfDQAOGxqbOgJWuxv3Cxw,116
|
158
|
+
micropython_stubber-1.24.0.dist-info/LICENSE,sha256=Fx9qrL45ayRXgH6QzttboqZEjKXms0w1t_b_nkOqYCU,1572
|
159
|
+
micropython_stubber-1.24.0.dist-info/METADATA,sha256=VFYvKOoekntu4U0wBy_DcDgbYWsqHKHzUrYJD_zAVDc,25020
|
160
|
+
micropython_stubber-1.24.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
161
|
+
micropython_stubber-1.24.0.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
@@ -10,7 +10,7 @@ from pathlib import Path
|
|
10
10
|
from typing import List, Optional, Union
|
11
11
|
|
12
12
|
import cachetools.func
|
13
|
-
from github import Auth, Github
|
13
|
+
from github import Auth, BadCredentialsException, Github
|
14
14
|
from loguru import logger as log
|
15
15
|
from packaging.version import parse
|
16
16
|
|
@@ -18,7 +18,11 @@ from packaging.version import parse
|
|
18
18
|
|
19
19
|
# Token with no permissions to avoid throttling
|
20
20
|
# 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
|
21
|
-
PAT_NO_ACCESS =
|
21
|
+
PAT_NO_ACCESS = (
|
22
|
+
"github_pat_"
|
23
|
+
+ "11AAHPVFQ0G4NTaQ73Bw5J"
|
24
|
+
+ "_fAp7K9sZ1qL8VFnI9g78eUlCdmOXHB3WzSdj2jtEYb4XF3N7PDJBl32qIxq"
|
25
|
+
)
|
22
26
|
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
23
27
|
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
24
28
|
|
@@ -35,9 +39,17 @@ def _run_local_git(
|
|
35
39
|
if repo:
|
36
40
|
if isinstance(repo, str):
|
37
41
|
repo = Path(repo)
|
38
|
-
result = subprocess.run(
|
42
|
+
result = subprocess.run(
|
43
|
+
cmd,
|
44
|
+
capture_output=capture_output,
|
45
|
+
check=True,
|
46
|
+
cwd=repo.absolute().as_posix(),
|
47
|
+
encoding="utf-8",
|
48
|
+
)
|
39
49
|
else:
|
40
|
-
result = subprocess.run(
|
50
|
+
result = subprocess.run(
|
51
|
+
cmd, capture_output=capture_output, check=True, encoding="utf-8"
|
52
|
+
)
|
41
53
|
except (NotADirectoryError, FileNotFoundError) as e: # pragma: no cover
|
42
54
|
return None
|
43
55
|
except subprocess.CalledProcessError as e: # pragma: no cover
|
@@ -76,7 +88,9 @@ def clone(remote_repo: str, path: Path, shallow: bool = False, tag: Optional[str
|
|
76
88
|
return False
|
77
89
|
|
78
90
|
|
79
|
-
def get_local_tag(
|
91
|
+
def get_local_tag(
|
92
|
+
repo: Optional[Union[str, Path]] = None, abbreviate: bool = True
|
93
|
+
) -> Union[str, None]:
|
80
94
|
"""
|
81
95
|
get the most recent git version tag of a local repo
|
82
96
|
repo Path should be in the form of : repo = "./repo/micropython"
|
@@ -122,15 +136,22 @@ def get_local_tags(repo: Optional[Path] = None, minver: Optional[str] = None) ->
|
|
122
136
|
return sorted(tags)
|
123
137
|
|
124
138
|
|
139
|
+
from github.GithubException import BadCredentialsException
|
140
|
+
|
141
|
+
|
125
142
|
@cachetools.func.ttl_cache(maxsize=16, ttl=60) # 60 seconds
|
126
143
|
def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
|
127
144
|
"""
|
128
|
-
Get list of tag of a repote github repo
|
145
|
+
Get list of tag of a repote github repo.
|
146
|
+
only the last -preview tag is kept
|
129
147
|
"""
|
130
148
|
if not repo or not isinstance(repo, str) or "/" not in repo: # type: ignore
|
131
149
|
return []
|
132
150
|
try:
|
133
151
|
gh_repo = GH_CLIENT.get_repo(repo)
|
152
|
+
except BadCredentialsException as e:
|
153
|
+
log.error(f"Github authentication error - {e}")
|
154
|
+
return []
|
134
155
|
except ConnectionError as e:
|
135
156
|
# TODO: unable to capture the exeption
|
136
157
|
log.warning(f"Unable to get tags - {e}")
|
@@ -138,7 +159,9 @@ def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
|
|
138
159
|
tags = [tag.name for tag in gh_repo.get_tags()]
|
139
160
|
if minver:
|
140
161
|
tags = [tag for tag in tags if parse(tag) >= parse(minver)]
|
141
|
-
|
162
|
+
# remove all but the last preview
|
163
|
+
tags = [t for t in sorted(tags[:-1]) if "-preview" not in t] + sorted(tags)[-1:]
|
164
|
+
return tags
|
142
165
|
|
143
166
|
|
144
167
|
def checkout_tag(tag: str, repo: Optional[Union[str, Path]] = None) -> bool:
|
@@ -156,7 +179,7 @@ def checkout_tag(tag: str, repo: Optional[Union[str, Path]] = None) -> bool:
|
|
156
179
|
return True
|
157
180
|
|
158
181
|
|
159
|
-
def sync_submodules(repo:
|
182
|
+
def sync_submodules(repo: Union[Path, str]) -> bool:
|
160
183
|
"""
|
161
184
|
make sure any submodules are in sync
|
162
185
|
"""
|
@@ -171,9 +194,26 @@ def sync_submodules(repo: Optional[Union[Path, str]] = None) -> bool:
|
|
171
194
|
log.debug(result.stderr)
|
172
195
|
else:
|
173
196
|
return False
|
197
|
+
checkout_arduino_lib(Path(repo))
|
174
198
|
return True
|
175
199
|
|
176
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
|
+
|
177
217
|
def checkout_commit(commit_hash: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
178
218
|
"""
|
179
219
|
Checkout a specific commit
|
@@ -222,7 +262,7 @@ def switch_branch(branch: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
|
222
262
|
|
223
263
|
def fetch(repo: Union[Path, str]) -> bool:
|
224
264
|
"""
|
225
|
-
fetches a repo
|
265
|
+
fetches a repo and all tags
|
226
266
|
repo should be in the form of : path/.git
|
227
267
|
repo = '../micropython/.git'
|
228
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,16 +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 = (
|
34
|
-
"github_pat"
|
35
|
-
+ "_11AAHPVFQ0qAkDnSUaMKSp"
|
36
|
-
+ "_ZkDl5NRRwBsUN6EYg9ahp1Dvj4FDDONnXVgimxC2EtpY7Q7BUKBoQ0Jq72X"
|
37
|
-
)
|
38
|
-
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
39
|
-
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
40
|
-
|
41
31
|
|
42
32
|
@dataclass
|
43
33
|
class FWInfo:
|
@@ -138,12 +128,24 @@ def filtered_comports(
|
|
138
128
|
elif not isinstance(include, list): # type: ignore
|
139
129
|
include = list(include)
|
140
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
|
+
|
141
137
|
# remove ports that are to be ignored
|
142
138
|
log.trace(f"{include=}, {ignore=}, {bluetooth=}")
|
143
139
|
|
144
140
|
comports = [
|
145
141
|
p for p in list_ports.comports() if not any(fnmatch.fnmatch(p.device, i) for i in ignore)
|
146
142
|
]
|
143
|
+
|
144
|
+
if False:
|
145
|
+
import jsons
|
146
|
+
|
147
|
+
print(jsons.dumps(comports).replace('{"description":', '\n{"description":'))
|
148
|
+
|
147
149
|
if platform.system() == "Linux":
|
148
150
|
# use p.location to filter out the bogus ports on newer Linux kernels
|
149
151
|
# filter out the bogus ports on newer Linux kernels
|
@@ -164,16 +166,21 @@ def filtered_comports(
|
|
164
166
|
else:
|
165
167
|
# if there are ports to ignore, add the explicit list to the filtered list
|
166
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
|
+
|
167
173
|
if not bluetooth:
|
168
174
|
# filter out bluetooth ports
|
169
175
|
comports = [p for p in comports if "bluetooth" not in p.description.lower()]
|
170
176
|
comports = [p for p in comports if "BTHENUM" not in p.hwid]
|
171
|
-
if
|
177
|
+
if platform.system() == "Darwin":
|
172
178
|
comports = [p for p in comports if ".Bluetooth" not in p.device]
|
173
|
-
|
179
|
+
# filter out ports with no hwid
|
180
|
+
comports = [p for p in comports if p.hwid != "n/a"]
|
174
181
|
log.debug(f"filtered_comports: {[p.device for p in comports]}")
|
175
182
|
# sort
|
176
|
-
if
|
183
|
+
if platform.system() == "Windows":
|
177
184
|
# Windows sort of comports by number - but fallback to device name
|
178
185
|
return sorted(
|
179
186
|
comports,
|
@@ -187,7 +194,7 @@ def find_serial_by_path(target_port: str):
|
|
187
194
|
"""Find the symbolic link path of a serial port by its device path."""
|
188
195
|
# sourcery skip: use-next
|
189
196
|
|
190
|
-
if
|
197
|
+
if platform.system() == "Windows":
|
191
198
|
return None
|
192
199
|
# List all available serial ports
|
193
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
|
@@ -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]
|