mpflash 1.24.2__py3-none-any.whl → 1.24.3__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/basicgit.py +1 -1
- mpflash/mpboard_id/add_boards.py +18 -5
- mpflash/mpboard_id/board.py +2 -2
- mpflash/mpboard_id/board_info.zip +0 -0
- mpflash/versions.py +6 -4
- {mpflash-1.24.2.dist-info → mpflash-1.24.3.dist-info}/METADATA +3 -3
- {mpflash-1.24.2.dist-info → mpflash-1.24.3.dist-info}/RECORD +10 -10
- {mpflash-1.24.2.dist-info → mpflash-1.24.3.dist-info}/LICENSE +0 -0
- {mpflash-1.24.2.dist-info → mpflash-1.24.3.dist-info}/WHEEL +0 -0
- {mpflash-1.24.2.dist-info → mpflash-1.24.3.dist-info}/entry_points.txt +0 -0
mpflash/basicgit.py
CHANGED
@@ -242,7 +242,7 @@ def switch_branch(branch: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
|
242
242
|
|
243
243
|
def fetch(repo: Union[Path, str]) -> bool:
|
244
244
|
"""
|
245
|
-
fetches a repo
|
245
|
+
fetches a repo and all tags
|
246
246
|
repo should be in the form of : path/.git
|
247
247
|
repo = '../micropython/.git'
|
248
248
|
returns True on success
|
mpflash/mpboard_id/add_boards.py
CHANGED
@@ -25,7 +25,9 @@ RE_H_MICROPY_HW_BOARD_NAME = re.compile(r"#define\s+MICROPY_HW_BOARD_NAME\s+\"(.
|
|
25
25
|
RE_H_MICROPY_HW_MCU_NAME = re.compile(r"#define\s+MICROPY_HW_MCU_NAME\s+\"(.+)\"")
|
26
26
|
# find in the mpconfigboard.cmake files
|
27
27
|
|
28
|
-
RE_CMAKE_MICROPY_HW_BOARD_NAME = re.compile(
|
28
|
+
RE_CMAKE_MICROPY_HW_BOARD_NAME = re.compile(
|
29
|
+
r"MICROPY_HW_BOARD_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\""
|
30
|
+
)
|
29
31
|
RE_CMAKE_MICROPY_HW_MCU_NAME = re.compile(r"MICROPY_HW_MCU_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\"")
|
30
32
|
# TODO: normal make files
|
31
33
|
|
@@ -118,7 +120,9 @@ def boards_from_headers(mpy_path: Path, version: str, family: str):
|
|
118
120
|
mcu_name = match[1]
|
119
121
|
found += 1
|
120
122
|
if found == 2:
|
121
|
-
description =
|
123
|
+
description = (
|
124
|
+
f"{board_name} with {mcu_name}" if mcu_name != "-" else board_name
|
125
|
+
)
|
122
126
|
board_list.append(
|
123
127
|
Board(
|
124
128
|
board_id=board,
|
@@ -160,6 +164,8 @@ def boards_for_versions(versions: List[str], mpy_path: Path):
|
|
160
164
|
List[Board]: The list of Board objects.
|
161
165
|
"""
|
162
166
|
board_list: List[Board] = []
|
167
|
+
# first fetch all tags from the repository
|
168
|
+
git.fetch(mpy_path)
|
163
169
|
for version in track(versions, description="Searching MicroPython versions"):
|
164
170
|
if git.checkout_tag(tag=version, repo=mpy_path):
|
165
171
|
new_ones = boards_from_repo(mpy_path, version, family="micropython")
|
@@ -197,9 +203,10 @@ def make_table(board_list: List[Board]) -> rich.table.Table:
|
|
197
203
|
is_wide = True
|
198
204
|
|
199
205
|
table = rich.table.Table(title="MicroPython Board Information")
|
206
|
+
table.add_column("Port", justify="left", style="magenta")
|
200
207
|
table.add_column("BOARD_ID", justify="left", style="green")
|
208
|
+
table.add_column("Variant(s)", justify="left", style="blue")
|
201
209
|
table.add_column("Description", justify="left", style="cyan")
|
202
|
-
table.add_column("Port", justify="left", style="magenta")
|
203
210
|
table.add_column("Board Name", justify="left", style="blue")
|
204
211
|
if is_wide:
|
205
212
|
table.add_column("MCU Name", justify="left", style="blue")
|
@@ -209,7 +216,7 @@ def make_table(board_list: List[Board]) -> rich.table.Table:
|
|
209
216
|
table.add_column("Family", justify="left", style="blue")
|
210
217
|
|
211
218
|
for board in board_list:
|
212
|
-
row = [board.board_id, board.
|
219
|
+
row = [board.port, board.board_id, board.variant, board.description, board.board_name]
|
213
220
|
if is_wide:
|
214
221
|
row.append(board.mcu_name)
|
215
222
|
row.extend((str(Path(board.path).suffix), board.version))
|
@@ -222,7 +229,13 @@ def make_table(board_list: List[Board]) -> rich.table.Table:
|
|
222
229
|
|
223
230
|
def ask_mpy_path():
|
224
231
|
"""Ask the user for the path to the MicroPython repository."""
|
225
|
-
questions = [
|
232
|
+
questions = [
|
233
|
+
inquirer.Text(
|
234
|
+
"mpy_path",
|
235
|
+
message="Enter the path to the MicroPython repository",
|
236
|
+
default=".\\repos\\micropython",
|
237
|
+
)
|
238
|
+
]
|
226
239
|
if answers := inquirer.prompt(questions):
|
227
240
|
return Path(answers["mpy_path"])
|
228
241
|
else:
|
mpflash/mpboard_id/board.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
from dataclasses import dataclass, field
|
2
2
|
from pathlib import Path
|
3
|
-
from typing import
|
3
|
+
from typing import Union
|
4
4
|
|
5
5
|
|
6
6
|
# - source : get_boardnames.py
|
@@ -20,7 +20,7 @@ class Board:
|
|
20
20
|
family: str = field(default="micropython")
|
21
21
|
mcu_name: str = field(default="")
|
22
22
|
cpu: str = field(default="")
|
23
|
-
|
23
|
+
variant: str = field(default="")
|
24
24
|
|
25
25
|
def __post_init__(self):
|
26
26
|
if not self.cpu:
|
Binary file
|
mpflash/versions.py
CHANGED
@@ -72,16 +72,16 @@ def clean_version(
|
|
72
72
|
|
73
73
|
|
74
74
|
@cache_to_disk(n_days_to_cache=1)
|
75
|
-
def micropython_versions(minver: str = "v1.20", reverse: bool = False):
|
75
|
+
def micropython_versions(minver: str = "v1.20", reverse: bool = False, cache_it=True):
|
76
76
|
"""Get the list of micropython versions from github tags"""
|
77
|
-
|
77
|
+
|
78
78
|
try:
|
79
79
|
gh_client = GH_CLIENT
|
80
80
|
repo = gh_client.get_repo("micropython/micropython")
|
81
81
|
versions = [tag.name for tag in repo.get_tags() if parse(tag.name) >= parse(minver)]
|
82
82
|
# Only keep the last preview
|
83
83
|
versions = [v for v in versions if not v.endswith(V_PREVIEW) or v == versions[-1]]
|
84
|
-
except Exception:
|
84
|
+
except Exception as e:
|
85
85
|
versions = [
|
86
86
|
"v9.99.9-preview",
|
87
87
|
"v1.22.2",
|
@@ -105,7 +105,9 @@ def micropython_versions(minver: str = "v1.20", reverse: bool = False):
|
|
105
105
|
cache_it = False
|
106
106
|
versions = [v for v in versions if parse(v) >= parse(minver)]
|
107
107
|
# remove all but the most recent (preview) version
|
108
|
-
versions =
|
108
|
+
versions = [v for v in versions if "preview" in v][:1] + [
|
109
|
+
v for v in versions if "preview" not in v
|
110
|
+
]
|
109
111
|
versions = sorted(versions, reverse=reverse)
|
110
112
|
if cache_it:
|
111
113
|
return versions
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mpflash
|
3
|
-
Version: 1.24.
|
3
|
+
Version: 1.24.3
|
4
4
|
Summary: Flash and download tool for MicroPython firmwares
|
5
5
|
Home-page: https://github.com/Josverl/micropython-stubber/blob/main/src/mpflash/README.md
|
6
6
|
License: MIT
|
@@ -51,7 +51,7 @@ Description-Content-Type: text/markdown
|
|
51
51
|
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.
|
52
52
|
|
53
53
|
`mpflash` has been tested on:
|
54
|
-
- OS: Windows x64, Linux X64,
|
54
|
+
- OS: Windows x64, Linux X64, and macOS.
|
55
55
|
- Micropython (hardware) ports:
|
56
56
|
- `rp2`, using `.uf2`, using filecopy
|
57
57
|
- `samd`, using ` .uf2`, using filecopy
|
@@ -59,7 +59,7 @@ This tool was initially created to be used in a CI/CD pipeline to automate the p
|
|
59
59
|
- `esp8266`, using `.bin`, using esptool
|
60
60
|
- `stm32`, using ` .dfu`, using pydfu
|
61
61
|
|
62
|
-
Not yet implemented: `nrf`, `cc3200`, `mimxrt`
|
62
|
+
Not yet implemented: `nrf`, `cc3200`, `mimxrt`, `renesas`
|
63
63
|
|
64
64
|
## Features
|
65
65
|
1. List the connected boards including their firmware details, in a tabular or json format
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
mpflash/add_firmware.py,sha256=1h0HsA-EVi3HXLmoEvzwY_a-GuWYzPwulTYHHBB8THg,3428
|
3
3
|
mpflash/ask_input.py,sha256=RJHGGrhYniSu-bdoKnKptE3DtpiCREJGRTZmFazvG-E,8946
|
4
|
-
mpflash/basicgit.py,sha256=
|
4
|
+
mpflash/basicgit.py,sha256=ClFBBfx6jXvRfU1e0p7HI-MEUzGwBrqE0lcO5JjeWQ0,9972
|
5
5
|
mpflash/bootloader/__init__.py,sha256=Qy3E6tETPnzMga9LgD5UgOvJ0zZIBEqhtEVb4v8CTWQ,107
|
6
6
|
mpflash/bootloader/activate.py,sha256=FlO4XQlKyoOuvmDdj_0u_mjNPhjGwB_K17jQ-8nSXRA,2361
|
7
7
|
mpflash/bootloader/detect.py,sha256=fBrILi7-ICRaregqms3PYqwiQVAJC0rXVhpyzDkoPQI,2690
|
@@ -33,10 +33,10 @@ mpflash/flash/worklist.py,sha256=owS3xJbWC-SzbK9z6jQER0Kat3OIV09IxnV-f-tjGlY,599
|
|
33
33
|
mpflash/list.py,sha256=lP_S5xbC0Men9HsXcIxOsP0bFRlCYh5CynMLFJx8cEE,3607
|
34
34
|
mpflash/logger.py,sha256=dI_H_a7EOdQJyvoeRHQuYeZuTKYVUS3DUPTLhE9rkdM,1098
|
35
35
|
mpflash/mpboard_id/__init__.py,sha256=b9PJiKFqmfyYgfi0-pbWGp2mrljdgvO6DNy0ABS8izU,3898
|
36
|
-
mpflash/mpboard_id/add_boards.py,sha256=
|
37
|
-
mpflash/mpboard_id/board.py,sha256=
|
36
|
+
mpflash/mpboard_id/add_boards.py,sha256=sM32QWguCRuLhKO0H8KUoy4MVr_8dzJpYHUSS5KNPgw,9906
|
37
|
+
mpflash/mpboard_id/board.py,sha256=JKb4T67HmK7widW-4c1PgilvywMbZYToLk9Fyokm-6Q,1163
|
38
38
|
mpflash/mpboard_id/board_id.py,sha256=MnDWPqp0OqCkWD3E1Mhg-g20qASgPVHdROOCdr5TpOU,3249
|
39
|
-
mpflash/mpboard_id/board_info.zip,sha256=
|
39
|
+
mpflash/mpboard_id/board_info.zip,sha256=DC_yHwL8A8IC0YsA2ZXjlRLZkLKiw03k4FR2HSTfBXw,21328
|
40
40
|
mpflash/mpboard_id/store.py,sha256=n85vnUAxGKv1C23wkm22ZFAFGK6AZZiCFvc1lGJJjis,1703
|
41
41
|
mpflash/mpremoteboard/__init__.py,sha256=3F6vZHM1znUOnAo0ne-FalApM6vwbTNYg4kJwkS1gNI,9521
|
42
42
|
mpflash/mpremoteboard/mpy_fw_info.py,sha256=eRjhqN7MpmYE9TiS4iukquZZs3QE_lD5zv_vOPSjNrk,4821
|
@@ -45,9 +45,9 @@ mpflash/vendor/click_aliases.py,sha256=c853EHSlkE2DvFqeFvFpwXKuJj3_jsXDP7iotVOKa
|
|
45
45
|
mpflash/vendor/dfu.py,sha256=ZXMcE6aH4-43Wh4tbQT4U-q-BU3RUiL3JAxmP_QAK2s,5755
|
46
46
|
mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
|
47
47
|
mpflash/vendor/readme.md,sha256=iIIZxuLUIGHQ0KODzYVtMezsztvyxCXcNJp_AzwTIPk,86
|
48
|
-
mpflash/versions.py,sha256=
|
49
|
-
mpflash-1.24.
|
50
|
-
mpflash-1.24.
|
51
|
-
mpflash-1.24.
|
52
|
-
mpflash-1.24.
|
53
|
-
mpflash-1.24.
|
48
|
+
mpflash/versions.py,sha256=PKJyBF7iK3nAQ3kE06-31QQqmvRA8JPHtCphhzIkScQ,4675
|
49
|
+
mpflash-1.24.3.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
|
50
|
+
mpflash-1.24.3.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
|
51
|
+
mpflash-1.24.3.dist-info/METADATA,sha256=d11Vn2rmmYmtInvpQ2ts23ycuKoDlEqA1ryZa5waPBo,17651
|
52
|
+
mpflash-1.24.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
53
|
+
mpflash-1.24.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|