mpflash 1.26.2__py3-none-any.whl → 1.26.4__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.
- mpflash/__init__.py +1 -0
- mpflash/ask_input.py +11 -4
- mpflash/cli_flash.py +28 -29
- mpflash/connected.py +0 -2
- mpflash/db/boards_version.txt +1 -0
- mpflash/db/core.py +2 -2
- mpflash/db/gather_boards.py +67 -17
- mpflash/db/loader.py +15 -2
- mpflash/db/micropython_boards.zip +0 -0
- mpflash/download/__init__.py +5 -9
- mpflash/download/jid.py +38 -44
- mpflash/flash/__init__.py +13 -13
- mpflash/flash/uf2/__init__.py +16 -5
- mpflash/flash/worklist.py +299 -132
- mpflash/logger.py +79 -5
- mpflash/mpremoteboard/__init__.py +10 -8
- mpflash/mpremoteboard/runner.py +15 -4
- {mpflash-1.26.2.dist-info → mpflash-1.26.4.dist-info}/METADATA +32 -6
- {mpflash-1.26.2.dist-info → mpflash-1.26.4.dist-info}/RECORD +22 -21
- {mpflash-1.26.2.dist-info → mpflash-1.26.4.dist-info}/WHEEL +0 -0
- {mpflash-1.26.2.dist-info → mpflash-1.26.4.dist-info}/entry_points.txt +0 -0
- {mpflash-1.26.2.dist-info → mpflash-1.26.4.dist-info}/licenses/LICENSE +0 -0
mpflash/mpremoteboard/runner.py
CHANGED
@@ -6,6 +6,7 @@ import subprocess
|
|
6
6
|
from dataclasses import dataclass
|
7
7
|
from threading import Timer
|
8
8
|
from typing import List, Optional, Tuple
|
9
|
+
from unittest.mock import DEFAULT
|
9
10
|
|
10
11
|
from loguru import logger as log
|
11
12
|
|
@@ -31,6 +32,14 @@ DEFAULT_RESET_TAGS = [
|
|
31
32
|
"rst:0x10 (RTCWDT_RTC_RESET)",
|
32
33
|
]
|
33
34
|
|
35
|
+
DEFAULT_ERROR_TAGS = ["Traceback ", "Error: ", "Exception: ", "ERROR :", "CRIT :"]
|
36
|
+
DEFAULT_WARNING_TAGS = ["WARN :", "TRACE :"]
|
37
|
+
DEFAULT_SUCCESS_TAGS = ["Done", "File saved", "File removed", "File renamed"]
|
38
|
+
DEFAULT_IGNORE_TAGS = [
|
39
|
+
' File "<stdin>",',
|
40
|
+
"mpremote: rm -r: cannot remove :/ Operation not permitted",
|
41
|
+
]
|
42
|
+
|
34
43
|
|
35
44
|
def run(
|
36
45
|
cmd: List[str],
|
@@ -70,13 +79,13 @@ def run(
|
|
70
79
|
if not reset_tags:
|
71
80
|
reset_tags = DEFAULT_RESET_TAGS
|
72
81
|
if not error_tags:
|
73
|
-
error_tags =
|
82
|
+
error_tags = DEFAULT_ERROR_TAGS
|
74
83
|
if not warning_tags:
|
75
|
-
warning_tags =
|
84
|
+
warning_tags = DEFAULT_WARNING_TAGS
|
76
85
|
if not success_tags:
|
77
|
-
success_tags =
|
86
|
+
success_tags = DEFAULT_SUCCESS_TAGS
|
78
87
|
if not ignore_tags:
|
79
|
-
ignore_tags =
|
88
|
+
ignore_tags = DEFAULT_IGNORE_TAGS
|
80
89
|
|
81
90
|
replace_tags = ["\x1b[1A"]
|
82
91
|
|
@@ -132,6 +141,8 @@ def run(
|
|
132
141
|
log.info(line)
|
133
142
|
if proc.stderr and log_errors:
|
134
143
|
for line in proc.stderr:
|
144
|
+
if any(tag in line for tag in ignore_tags):
|
145
|
+
continue
|
135
146
|
log.warning(line)
|
136
147
|
except UnicodeDecodeError as e:
|
137
148
|
log.error(f"Failed to decode output: {e}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mpflash
|
3
|
-
Version: 1.26.
|
3
|
+
Version: 1.26.4
|
4
4
|
Summary: Flash and download tool for MicroPython firmwares
|
5
5
|
Project-URL: Homepage, https://github.com/Josverl/mpflash
|
6
6
|
Project-URL: Documentation, https://github.com/Josverl/mpflash/blob/main/README.md
|
@@ -50,16 +50,12 @@ Requires-Dist: tomli-w>=1.2.0
|
|
50
50
|
Requires-Dist: tomli>=2.2.1
|
51
51
|
Provides-Extra: dev
|
52
52
|
Requires-Dist: ipykernel>=6.29.5; extra == 'dev'
|
53
|
-
Requires-Dist: pandas>=2.2.3; extra == 'dev'
|
54
53
|
Requires-Dist: tornado>=6.5; extra == 'dev'
|
55
|
-
Provides-Extra: perf
|
56
|
-
Requires-Dist: scalene>=1.5.51; extra == 'perf'
|
57
54
|
Provides-Extra: test
|
58
55
|
Requires-Dist: coverage<8.0.0,>=6.4.3; extra == 'test'
|
59
56
|
Requires-Dist: distro>=1.8.0; extra == 'test'
|
60
57
|
Requires-Dist: fasteners>=0.19; extra == 'test'
|
61
58
|
Requires-Dist: mock<6.0.0,>=4.0.3; extra == 'test'
|
62
|
-
Requires-Dist: pandas>=2.2.3; extra == 'test'
|
63
59
|
Requires-Dist: pytest-cov>=6.0.0; extra == 'test'
|
64
60
|
Requires-Dist: pytest-github-actions-annotate-failures<0.4.0,>=0.1.7; extra == 'test'
|
65
61
|
Requires-Dist: pytest-json-report>=1.5.0; extra == 'test'
|
@@ -101,6 +97,17 @@ This release includes several new features and improvements:
|
|
101
97
|
- Restructured mpboard_id to use a SQLite db to be able to ID more boards and variants
|
102
98
|
- vendored and adapted `board_database.py` from mpflash, kudos @mattytrentini
|
103
99
|
|
100
|
+
## ⚠️ Breaking API Changes (v1.26+)
|
101
|
+
|
102
|
+
**Important for Library Users**: The worklist module API has been completely refactored with breaking changes.
|
103
|
+
Legacy worklist functions have been **removed**.
|
104
|
+
|
105
|
+
- **Removed Functions**: `auto_update_worklist()`, `manual_worklist()`, `manual_board()`, `single_auto_worklist()`, `full_auto_worklist()`, `filter_boards()`
|
106
|
+
- **New API**: Modern interface with `create_worklist()`, `FlashTask` dataclass, and `WorklistConfig` objects
|
107
|
+
- **CLI Unchanged**: Command-line interface remains fully compatible
|
108
|
+
|
109
|
+
See [API Documentation](docs/api-reference.md) for complete migration guide.
|
110
|
+
|
104
111
|
|
105
112
|
## Features
|
106
113
|
1. List the connected boards including their firmware details, in a tabular or json format
|
@@ -198,7 +205,26 @@ On Windows this will not be an issue, but on Linux you can use udev rules to gi
|
|
198
205
|
|
199
206
|
MPFlash can be used as a library in your own project. mpflash is used in [micropython-stubber]() to download and flash the firmware to the connected boards.
|
200
207
|
|
201
|
-
|
208
|
+
**⚠️ API Changes**: The worklist module API has been completely refactored in v1.25.1+. Legacy functions have been removed. See [API Documentation](docs/api-reference.md) for the new interface.
|
209
|
+
|
210
|
+
```python
|
211
|
+
# Modern API example
|
212
|
+
from mpflash.flash.worklist import create_worklist
|
213
|
+
from mpflash.connected import get_connected_comports
|
214
|
+
|
215
|
+
# Get connected boards and create worklist
|
216
|
+
boards = get_connected_comports()
|
217
|
+
tasks = create_worklist("1.25.0", connected_comports=boards)
|
218
|
+
|
219
|
+
# Process tasks
|
220
|
+
for task in tasks:
|
221
|
+
if task.is_valid:
|
222
|
+
print(f"{task.board.serialport} -> {task.firmware_version}")
|
223
|
+
```
|
224
|
+
|
225
|
+
The interface is documented in:
|
226
|
+
- [API Reference](docs/api-reference.md) - Complete programming interface
|
227
|
+
- [API Examples](docs/mpflash_api_example.ipynb) - Jupyter notebook with examples
|
202
228
|
|
203
229
|
## Detailed usage
|
204
230
|
You can list the connected boards using the following command:
|
@@ -1,19 +1,19 @@
|
|
1
|
-
mpflash/__init__.py,sha256=
|
2
|
-
mpflash/ask_input.py,sha256=
|
1
|
+
mpflash/__init__.py,sha256=tToFcmhcOordC-FrA0Jv3bkyApqZaNjIiqebgzF-s2I,53
|
2
|
+
mpflash/ask_input.py,sha256=TzrieNyhboX1it7b6n6bIL5ZKC1pB0_ly7sIzjH77CQ,9244
|
3
3
|
mpflash/basicgit.py,sha256=lpGQxL10Mq8D8S56h87aMrBH0vo18ji_hE9v0KJ9P-o,10245
|
4
4
|
mpflash/cli_add.py,sha256=hI-o-9hAGD3U8cbpXvy9Nuv1KHNTZ6mS57LC4BTBtj8,3495
|
5
5
|
mpflash/cli_download.py,sha256=v5aWJIv1bB5cinGa5BL0nS5vJ97dsFXaLpAaKN0RnrU,3528
|
6
|
-
mpflash/cli_flash.py,sha256=
|
6
|
+
mpflash/cli_flash.py,sha256=9SLtDqVrzeYNW6GRLnYrd7Uxh8O6rB4WgM58pjY7Q5k,8799
|
7
7
|
mpflash/cli_group.py,sha256=RITn2u1_77jKptapX0Vz3oUriPtGMzLVmjZOtM5SP88,2686
|
8
8
|
mpflash/cli_list.py,sha256=dznrQrWQXvev20ai5AFvz2DFe3MNDR5RIrJmtvQou6A,2693
|
9
9
|
mpflash/cli_main.py,sha256=w5o3swYWDZUnYwIH46hGMCiFdPKVL1-R1YJRM-RSMiY,1496
|
10
10
|
mpflash/common.py,sha256=wO3BjG1wtbfi37wNWPnmLk3jNi7kRUl1vTzgJUOwm9I,6355
|
11
11
|
mpflash/config.py,sha256=3JIOuKcVIWzV3Y24n6ag_XJpSczMcCbd1fa6FpWGiz8,4143
|
12
|
-
mpflash/connected.py,sha256=
|
12
|
+
mpflash/connected.py,sha256=ri6Sl58eZWd-uGs8aiIv4XAgviCxAqSSJD51UQ016UU,3563
|
13
13
|
mpflash/downloaded.py,sha256=xaeMYrTIGj_v4scUBojeJPL-U1kWJG-bdvkvJMbPh4Q,4218
|
14
14
|
mpflash/errors.py,sha256=IAidY3qkZsXy6Pm1rdmVFmGyg81ywHhse3itaPctA2w,247
|
15
15
|
mpflash/list.py,sha256=IrJa3UBjhHHfStbb9fPVYA8JJzoFTyXtbcKGNRSH8sE,4132
|
16
|
-
mpflash/logger.py,sha256=
|
16
|
+
mpflash/logger.py,sha256=N2LhJlErTxZ_ipGRjZuGfsQppSdIIeLiFE_r7Nz6Ww4,5282
|
17
17
|
mpflash/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
mpflash/versions.py,sha256=HuujLNdMKY_mQXyEqwXVHcU8nbuXeBiWP2TMA5JQhr4,4884
|
19
19
|
mpflash/bootloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -25,23 +25,24 @@ mpflash/bootloader/touch1200.py,sha256=VND7_YniS9Vx6WEaAxjI72RZZ6WBOwmBTsKJkbuaA
|
|
25
25
|
mpflash/custom/__init__.py,sha256=l9RU9hRm9j7IuRgacw-gHYjA2Op-5prvRO5yyODhFMQ,5269
|
26
26
|
mpflash/custom/naming.py,sha256=uHQzFIDzuWQUNajeGSUcf_A-o7cxX37kfgXhzpFHNtk,3304
|
27
27
|
mpflash/db/__init__.py,sha256=wnIlO4nOXsPGXMbn2OCqHRsR-hUmtJsko8VdqjH3ZUE,45
|
28
|
-
mpflash/db/
|
29
|
-
mpflash/db/
|
30
|
-
mpflash/db/
|
28
|
+
mpflash/db/boards_version.txt,sha256=8qTPMyXJDDLrpqktO8UUJcJyfYeH6lZSw425voqPZus,17
|
29
|
+
mpflash/db/core.py,sha256=v9BCXsPwjAwO-bRPM304XFqUv9KTLBJF_NXtGRoJgRI,5243
|
30
|
+
mpflash/db/gather_boards.py,sha256=C9KL-mdNZw3oukutv_KWFkOJDiFz1mhdShu7lbIpnYs,5494
|
31
|
+
mpflash/db/loader.py,sha256=R4pEuXc9jN7v4BMFJKvArnhugniBHsLNZQz6Ijr5W9U,5350
|
31
32
|
mpflash/db/meta.py,sha256=2pFTpFH-1zejGIDp2vs0hbX5rqUONt7B1WIvf8qBx5s,2248
|
32
|
-
mpflash/db/micropython_boards.zip,sha256=
|
33
|
+
mpflash/db/micropython_boards.zip,sha256=WGZsFFsPeGn_FyCgOAu1OSMDcHmOV8OMHtAyWpCW3zc,18046
|
33
34
|
mpflash/db/models.py,sha256=hZrum-nS-TNFaZAksApjxYMBgGKI_kJ-4oFxc8a4WRk,3572
|
34
35
|
mpflash/db/tools.py,sha256=6SEGfshNob4yRQ4h-Cj_xcWMRY28sbA8CWauNXV_uMI,814
|
35
|
-
mpflash/download/__init__.py,sha256=
|
36
|
+
mpflash/download/__init__.py,sha256=3N7cj1To5HqEC2-kGY-jFCwKyrPMrx1SJVTrlqz_7Ow,9420
|
36
37
|
mpflash/download/from_web.py,sha256=PVJDaFfYLJGXlPva5fExh4Yg2H7j3idyJEcfOiVVJBs,7608
|
37
38
|
mpflash/download/fwinfo.py,sha256=XGWOWoJ9cqRVtBAgzVYWCIWaBZpLK595SniXn7bzrRk,1844
|
38
|
-
mpflash/download/jid.py,sha256=
|
39
|
-
mpflash/flash/__init__.py,sha256=
|
39
|
+
mpflash/download/jid.py,sha256=fzCKU2I-iGdxZb7fyVXgXM4be3htQcrDrd3fCgVGZy0,2034
|
40
|
+
mpflash/flash/__init__.py,sha256=6RquZPQCUBsdgCAPaddug2tIjLRR3dxp1MhXIqx5_uY,3430
|
40
41
|
mpflash/flash/esp.py,sha256=4977E1hDqJ4-EIkLzwrUtgZuc0ZTD7NvP1PQZgZ2DoU,3227
|
41
42
|
mpflash/flash/stm32.py,sha256=jNgMpJaxUwtJ-v6VU1luD1t41AQprCUeNVCVEovxQe0,595
|
42
43
|
mpflash/flash/stm32_dfu.py,sha256=W-3JsRQyf3DduoIRXDmGZ35RogqtjQgcJnk-GOtQoLE,3090
|
43
|
-
mpflash/flash/worklist.py,sha256=
|
44
|
-
mpflash/flash/uf2/__init__.py,sha256=
|
44
|
+
mpflash/flash/worklist.py,sha256=26cUK_rW5WQOcAnvyl_vcdQcmiHg38rlOw0OwIM5jK0,12538
|
45
|
+
mpflash/flash/uf2/__init__.py,sha256=fCTQLwI8jigzGY0zVWB1XmqyieNFDRHOWky2slZjZEM,4145
|
45
46
|
mpflash/flash/uf2/boardid.py,sha256=U5wGM8VA3wEpUxQCMtuXpMZZomdVH8J_Zd5_GekUMuU,423
|
46
47
|
mpflash/flash/uf2/linux.py,sha256=uTgqyS7C7xfQ25RrTcSUkt-m2u2Ks_o7bPLzIecPoC8,4355
|
47
48
|
mpflash/flash/uf2/macos.py,sha256=JTaIpqnR_0k4oSEvzs9amhmK-PMxUJyZLnZ_wZwxa-0,1228
|
@@ -54,9 +55,9 @@ mpflash/mpboard_id/board_info.json,sha256=A3ZIt38KvAy2NMB5srHorSBd3Q3wOZIXufWiIs
|
|
54
55
|
mpflash/mpboard_id/board_info.zip,sha256=-2bnQGRsIQuJUfz-7_-GQ8pMWJ1evhCez6yfjhXocNw,23213
|
55
56
|
mpflash/mpboard_id/known.py,sha256=t-oREfW5P5Zue5zbte7WB9e7-mpZBF-NfHGTEUsOVLM,3521
|
56
57
|
mpflash/mpboard_id/resolve.py,sha256=5KCZ0Tcg3FYZ3HK_zux5EguwoSC2E03kCpW2fh4rN2A,779
|
57
|
-
mpflash/mpremoteboard/__init__.py,sha256=
|
58
|
+
mpflash/mpremoteboard/__init__.py,sha256=vjFwfa3XKDeugkzMDuswYfeImJm3ptQrYr3tIAY02f0,14301
|
58
59
|
mpflash/mpremoteboard/mpy_fw_info.py,sha256=ZDEPJN9XJnoG_oeWcLNiLJAD5bkVX2yI_j4K7msUxWM,5196
|
59
|
-
mpflash/mpremoteboard/runner.py,sha256=
|
60
|
+
mpflash/mpremoteboard/runner.py,sha256=4-KmWcktsuQfppGZ8iBfz-ov77Pp8v2dVsBKzcLGUtc,5374
|
60
61
|
mpflash/vendor/board_database.py,sha256=Cb8fEhJaZ2siMkLPW5rPwV9yzBsTtKGOqWUd9TxNgFM,8763
|
61
62
|
mpflash/vendor/click_aliases.py,sha256=adLhqLxNpJEPjSCIRSTkR-QzSgavGFKT0cwRbjxpzRU,5395
|
62
63
|
mpflash/vendor/dfu.py,sha256=6rqGCBS8mTxxaLtkdzJ8O6nc74kFk8jrkmKvxw-x-u8,5693
|
@@ -64,8 +65,8 @@ mpflash/vendor/pydfu.py,sha256=KD1RHHuhvhWi-l1UB6GyggkxouDKtZgkG4ivRbIfwC4,21264
|
|
64
65
|
mpflash/vendor/readme.md,sha256=BQ7Uxf8joeYMjTUuSLLBG49ob6a9MgFPIEwuc72-Mfw,415
|
65
66
|
mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt,sha256=Zkc2iTNbib2NCMwtLjMEz0vFCPglgvaw6Mj7QiWldpQ,1484
|
66
67
|
mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2,sha256=QuPMppqHMVOt3vDVU0bikHRLsTiDRQYNUcGQ_OLRFGI,28160
|
67
|
-
mpflash-1.26.
|
68
|
-
mpflash-1.26.
|
69
|
-
mpflash-1.26.
|
70
|
-
mpflash-1.26.
|
71
|
-
mpflash-1.26.
|
68
|
+
mpflash-1.26.4.dist-info/METADATA,sha256=NwpsLAVqtEEsM9_5QJltBonfXcIvKJpbkG9WY97i5HA,29201
|
69
|
+
mpflash-1.26.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
70
|
+
mpflash-1.26.4.dist-info/entry_points.txt,sha256=DZ24tsMKlCyTkjWet9vCoq5dcFeY43RKtTsLreQI_R8,53
|
71
|
+
mpflash-1.26.4.dist-info/licenses/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
|
72
|
+
mpflash-1.26.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|