mpflash 1.24.2__tar.gz → 1.24.3__tar.gz

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 (53) hide show
  1. {mpflash-1.24.2 → mpflash-1.24.3}/PKG-INFO +3 -3
  2. {mpflash-1.24.2 → mpflash-1.24.3}/README.md +2 -2
  3. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/basicgit.py +1 -1
  4. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpboard_id/add_boards.py +18 -5
  5. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpboard_id/board.py +2 -2
  6. mpflash-1.24.3/mpflash/mpboard_id/board_info.zip +0 -0
  7. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/versions.py +6 -4
  8. {mpflash-1.24.2 → mpflash-1.24.3}/pyproject.toml +1 -1
  9. mpflash-1.24.2/mpflash/mpboard_id/board_info.zip +0 -0
  10. {mpflash-1.24.2 → mpflash-1.24.3}/LICENSE +0 -0
  11. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/__init__.py +0 -0
  12. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/add_firmware.py +0 -0
  13. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/ask_input.py +0 -0
  14. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/__init__.py +0 -0
  15. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/activate.py +0 -0
  16. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/detect.py +0 -0
  17. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/manual.py +0 -0
  18. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/micropython.py +0 -0
  19. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/bootloader/touch1200.py +0 -0
  20. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/cli_download.py +0 -0
  21. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/cli_flash.py +0 -0
  22. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/cli_group.py +0 -0
  23. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/cli_list.py +0 -0
  24. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/cli_main.py +0 -0
  25. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/common.py +0 -0
  26. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/config.py +0 -0
  27. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/connected.py +0 -0
  28. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/download.py +0 -0
  29. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/downloaded.py +0 -0
  30. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/errors.py +0 -0
  31. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/__init__.py +0 -0
  32. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/esp.py +0 -0
  33. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/stm32.py +0 -0
  34. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/stm32_dfu.py +0 -0
  35. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/__init__.py +0 -0
  36. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/boardid.py +0 -0
  37. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/linux.py +0 -0
  38. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/macos.py +0 -0
  39. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/uf2disk.py +0 -0
  40. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/uf2/windows.py +0 -0
  41. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/flash/worklist.py +0 -0
  42. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/list.py +0 -0
  43. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/logger.py +0 -0
  44. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpboard_id/__init__.py +0 -0
  45. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpboard_id/board_id.py +0 -0
  46. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpboard_id/store.py +0 -0
  47. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpremoteboard/__init__.py +0 -0
  48. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpremoteboard/mpy_fw_info.py +0 -0
  49. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/mpremoteboard/runner.py +0 -0
  50. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/vendor/click_aliases.py +0 -0
  51. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/vendor/dfu.py +0 -0
  52. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/vendor/pydfu.py +0 -0
  53. {mpflash-1.24.2 → mpflash-1.24.3}/mpflash/vendor/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mpflash
3
- Version: 1.24.2
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, but not (yet) macOS.
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
@@ -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, but not (yet) macOS.
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
@@ -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
@@ -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(r"MICROPY_HW_BOARD_NAME\s?=\s?\"(?P<variant>[\w\s\S]*)\"")
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 = f"{board_name} with {mcu_name}" if mcu_name != "-" else board_name
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.description, *(board.port, board.board_name)]
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 = [inquirer.Text("mpy_path", message="Enter the path to the MicroPython repository", default=".\\repos\\micropython")]
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:
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass, field
2
2
  from pathlib import Path
3
- from typing import Union
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
- # TODO: add variant
23
+ variant: str = field(default="")
24
24
 
25
25
  def __post_init__(self):
26
26
  if not self.cpu:
@@ -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
- cache_it = True
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 = versions[:1] + [v for v in versions if "preview" not in v]
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
  [tool.poetry]
2
2
  name = "mpflash"
3
- version = "1.24.2"
3
+ version = "1.24.3"
4
4
  description = "Flash and download tool for MicroPython firmwares"
5
5
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes