mpflash 1.24.6__py3-none-any.whl → 1.24.8__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/ask_input.py +7 -7
- mpflash/basicgit.py +23 -57
- mpflash/bootloader/__init__.py +0 -2
- mpflash/bootloader/activate.py +1 -1
- mpflash/bootloader/detect.py +1 -2
- mpflash/bootloader/manual.py +0 -1
- mpflash/bootloader/touch1200.py +2 -2
- mpflash/cli_flash.py +28 -5
- mpflash/cli_group.py +1 -0
- mpflash/cli_list.py +2 -2
- mpflash/cli_main.py +1 -1
- mpflash/common.py +6 -14
- mpflash/config.py +26 -7
- mpflash/connected.py +6 -14
- mpflash/download.py +56 -23
- mpflash/downloaded.py +1 -5
- mpflash/flash/__init__.py +33 -18
- mpflash/flash/esp.py +40 -9
- mpflash/flash/uf2/__init__.py +18 -2
- mpflash/flash/uf2/linux.py +4 -9
- mpflash/flash/uf2/macos.py +1 -1
- mpflash/flash/uf2/windows.py +1 -1
- mpflash/flash/worklist.py +7 -2
- mpflash/list.py +17 -6
- mpflash/logger.py +1 -3
- mpflash/mpboard_id/__init__.py +6 -87
- mpflash/mpboard_id/add_boards.py +6 -8
- mpflash/mpboard_id/board_id.py +7 -6
- mpflash/mpboard_id/board_info.json +30974 -0
- mpflash/mpboard_id/board_info.zip +0 -0
- mpflash/mpboard_id/known.py +94 -0
- mpflash/mpboard_id/store.py +0 -2
- mpflash/mpremoteboard/__init__.py +13 -9
- mpflash/mpremoteboard/mpy_fw_info.py +14 -17
- mpflash/py.typed +0 -0
- mpflash/vendor/click_aliases.py +64 -0
- mpflash/vendor/dfu.py +2 -8
- mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt +21 -0
- mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2 +0 -0
- mpflash/vendor/pydfu.py +3 -14
- mpflash/vendor/readme.md +2 -0
- mpflash/versions.py +9 -6
- {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/METADATA +71 -13
- mpflash-1.24.8.dist-info/RECORD +59 -0
- {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/WHEEL +1 -1
- mpflash-1.24.6.dist-info/RECORD +0 -54
- {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/LICENSE +0 -0
- {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/entry_points.txt +0 -0
mpflash/mpboard_id/add_boards.py
CHANGED
@@ -16,7 +16,7 @@ import mpflash.basicgit as git
|
|
16
16
|
from mpflash.logger import log
|
17
17
|
from mpflash.mpboard_id import Board
|
18
18
|
from mpflash.mpboard_id.store import write_boardinfo_json
|
19
|
-
from mpflash.versions import micropython_versions
|
19
|
+
from mpflash.versions import get_preview_mp_version, micropython_versions
|
20
20
|
|
21
21
|
# look for all mpconfigboard.h files and extract the board name
|
22
22
|
# from the #define MICROPY_HW_BOARD_NAME "PYBD_SF6"
|
@@ -24,9 +24,7 @@ from mpflash.versions import micropython_versions
|
|
24
24
|
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 boards and variants in the mpconfigboard*.cmake files
|
27
|
-
RE_CMAKE_MICROPY_HW_BOARD_NAME = re.compile(
|
28
|
-
r"MICROPY_HW_BOARD_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\""
|
29
|
-
)
|
27
|
+
RE_CMAKE_MICROPY_HW_BOARD_NAME = re.compile(r"MICROPY_HW_BOARD_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\"")
|
30
28
|
RE_CMAKE_MICROPY_HW_MCU_NAME = re.compile(r"MICROPY_HW_MCU_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\"")
|
31
29
|
# TODO: normal make files
|
32
30
|
|
@@ -47,6 +45,8 @@ def boards_from_repo(mpy_path: Path, version: str, family: Optional[str] = None)
|
|
47
45
|
version = version or git.get_local_tag() # type: ignore
|
48
46
|
if not version:
|
49
47
|
raise ValueError("No version provided and no local tag found.")
|
48
|
+
elif version in ["main", "master"]:
|
49
|
+
version = get_preview_mp_version()
|
50
50
|
|
51
51
|
board_list: List[Board] = []
|
52
52
|
# look in mpconfigboard.h files
|
@@ -118,9 +118,7 @@ def boards_from_headers(mpy_path: Path, version: str, family: str):
|
|
118
118
|
mcu_name = match[1]
|
119
119
|
found += 1
|
120
120
|
if found == 2:
|
121
|
-
description =
|
122
|
-
f"{board_name} with {mcu_name}" if mcu_name != "-" else board_name
|
123
|
-
)
|
121
|
+
description = f"{board_name} with {mcu_name}" if mcu_name != "-" else board_name
|
124
122
|
board_list.append(
|
125
123
|
Board(
|
126
124
|
board_id=board,
|
@@ -231,7 +229,7 @@ def ask_mpy_path():
|
|
231
229
|
inquirer.Text(
|
232
230
|
"mpy_path",
|
233
231
|
message="Enter the path to the MicroPython repository",
|
234
|
-
default="
|
232
|
+
default="./repos/micropython",
|
235
233
|
)
|
236
234
|
]
|
237
235
|
if answers := inquirer.prompt(questions):
|
mpflash/mpboard_id/board_id.py
CHANGED
@@ -9,7 +9,7 @@ from typing import Optional
|
|
9
9
|
from mpflash.errors import MPFlashError
|
10
10
|
from mpflash.logger import log
|
11
11
|
from mpflash.mpboard_id.store import read_known_boardinfo
|
12
|
-
from mpflash.versions import clean_version, get_stable_mp_version
|
12
|
+
from mpflash.versions import clean_version, get_preview_mp_version, get_stable_mp_version
|
13
13
|
|
14
14
|
|
15
15
|
def find_board_id_by_description(
|
@@ -64,13 +64,15 @@ def _find_board_id_by_description(
|
|
64
64
|
short_descr = descr.split(" with ")[0]
|
65
65
|
if version:
|
66
66
|
# filter for matching version
|
67
|
-
if version in ("
|
68
|
-
# match last stable
|
67
|
+
if version in ("stable"):
|
69
68
|
version = get_stable_mp_version()
|
69
|
+
if version in ("preview", "master"):
|
70
|
+
version = get_preview_mp_version()
|
70
71
|
known_versions = sorted({b.version for b in candidate_boards})
|
71
72
|
if version not in known_versions:
|
72
|
-
log.trace(
|
73
|
-
version
|
73
|
+
log.trace(known_versions)
|
74
|
+
log.debug(f"Version {version} not found in board info, using latest stable version {get_stable_mp_version()}")
|
75
|
+
version = ".".join(get_stable_mp_version().split(".")[:2]) # take only major.minor
|
74
76
|
if version_matches := [b for b in candidate_boards if b.version.startswith(version)]:
|
75
77
|
candidate_boards = version_matches
|
76
78
|
else:
|
@@ -87,4 +89,3 @@ def _find_board_id_by_description(
|
|
87
89
|
if not matches:
|
88
90
|
raise MPFlashError(f"No board info found for description '{descr}' or '{short_descr}'")
|
89
91
|
return sorted(matches, key=lambda x: x.version)
|
90
|
-
|