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.
Files changed (48) hide show
  1. mpflash/ask_input.py +7 -7
  2. mpflash/basicgit.py +23 -57
  3. mpflash/bootloader/__init__.py +0 -2
  4. mpflash/bootloader/activate.py +1 -1
  5. mpflash/bootloader/detect.py +1 -2
  6. mpflash/bootloader/manual.py +0 -1
  7. mpflash/bootloader/touch1200.py +2 -2
  8. mpflash/cli_flash.py +28 -5
  9. mpflash/cli_group.py +1 -0
  10. mpflash/cli_list.py +2 -2
  11. mpflash/cli_main.py +1 -1
  12. mpflash/common.py +6 -14
  13. mpflash/config.py +26 -7
  14. mpflash/connected.py +6 -14
  15. mpflash/download.py +56 -23
  16. mpflash/downloaded.py +1 -5
  17. mpflash/flash/__init__.py +33 -18
  18. mpflash/flash/esp.py +40 -9
  19. mpflash/flash/uf2/__init__.py +18 -2
  20. mpflash/flash/uf2/linux.py +4 -9
  21. mpflash/flash/uf2/macos.py +1 -1
  22. mpflash/flash/uf2/windows.py +1 -1
  23. mpflash/flash/worklist.py +7 -2
  24. mpflash/list.py +17 -6
  25. mpflash/logger.py +1 -3
  26. mpflash/mpboard_id/__init__.py +6 -87
  27. mpflash/mpboard_id/add_boards.py +6 -8
  28. mpflash/mpboard_id/board_id.py +7 -6
  29. mpflash/mpboard_id/board_info.json +30974 -0
  30. mpflash/mpboard_id/board_info.zip +0 -0
  31. mpflash/mpboard_id/known.py +94 -0
  32. mpflash/mpboard_id/store.py +0 -2
  33. mpflash/mpremoteboard/__init__.py +13 -9
  34. mpflash/mpremoteboard/mpy_fw_info.py +14 -17
  35. mpflash/py.typed +0 -0
  36. mpflash/vendor/click_aliases.py +64 -0
  37. mpflash/vendor/dfu.py +2 -8
  38. mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt +21 -0
  39. mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2 +0 -0
  40. mpflash/vendor/pydfu.py +3 -14
  41. mpflash/vendor/readme.md +2 -0
  42. mpflash/versions.py +9 -6
  43. {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/METADATA +71 -13
  44. mpflash-1.24.8.dist-info/RECORD +59 -0
  45. {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/WHEEL +1 -1
  46. mpflash-1.24.6.dist-info/RECORD +0 -54
  47. {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/LICENSE +0 -0
  48. {mpflash-1.24.6.dist-info → mpflash-1.24.8.dist-info}/entry_points.txt +0 -0
@@ -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=".\\repos\\micropython",
232
+ default="./repos/micropython",
235
233
  )
236
234
  ]
237
235
  if answers := inquirer.prompt(questions):
@@ -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 ("preview", "stable"):
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(f"Version {version} not found in board info, using latest known version {known_versions[-1]}")
73
- version = '.'.join(known_versions[-1].split('.')[:2]) # take only major.minor
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
-