mpflash 1.26.4__py3-none-any.whl → 1.26.6__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 +44 -2
- mpflash/basicgit.py +0 -11
- mpflash/config.py +2 -1
- mpflash/db/micropython_boards.zip +0 -0
- mpflash/list.py +1 -1
- mpflash/logger.py +0 -48
- mpflash/mpremoteboard/mpy_fw_info.py +168 -34
- {mpflash-1.26.4.dist-info → mpflash-1.26.6.dist-info}/METADATA +1 -1
- {mpflash-1.26.4.dist-info → mpflash-1.26.6.dist-info}/RECORD +12 -12
- {mpflash-1.26.4.dist-info → mpflash-1.26.6.dist-info}/WHEEL +0 -0
- {mpflash-1.26.4.dist-info → mpflash-1.26.6.dist-info}/entry_points.txt +0 -0
- {mpflash-1.26.4.dist-info → mpflash-1.26.6.dist-info}/licenses/LICENSE +0 -0
mpflash/ask_input.py
CHANGED
|
@@ -13,7 +13,7 @@ from .common import DownloadParams, FlashParams, ParamType
|
|
|
13
13
|
from .config import config
|
|
14
14
|
from .mpboard_id import get_known_boards_for_port, known_ports, known_stored_boards
|
|
15
15
|
from .mpremoteboard import MPRemoteBoard
|
|
16
|
-
from .versions import micropython_versions
|
|
16
|
+
from .versions import clean_version, micropython_versions
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def ask_missing_params(
|
|
@@ -106,6 +106,7 @@ def ask_missing_params(
|
|
|
106
106
|
def filter_matching_boards(answers: dict) -> Sequence[Tuple[str, str]]:
|
|
107
107
|
"""
|
|
108
108
|
Filters the known boards based on the selected versions and returns the filtered boards.
|
|
109
|
+
If no boards are found for the requested version(s), falls back to previous stable/preview versions.
|
|
109
110
|
|
|
110
111
|
Args:
|
|
111
112
|
answers (dict): The user's answers.
|
|
@@ -114,8 +115,11 @@ def filter_matching_boards(answers: dict) -> Sequence[Tuple[str, str]]:
|
|
|
114
115
|
Sequence[Tuple[str, str]]: The filtered boards.
|
|
115
116
|
"""
|
|
116
117
|
versions = []
|
|
118
|
+
original_versions = []
|
|
119
|
+
|
|
117
120
|
# if version is not asked ; then need to get the version from the inputs
|
|
118
121
|
if "versions" in answers:
|
|
122
|
+
original_versions = list(answers["versions"])
|
|
119
123
|
versions = list(answers["versions"])
|
|
120
124
|
if "stable" in versions:
|
|
121
125
|
versions.remove("stable")
|
|
@@ -124,7 +128,45 @@ def filter_matching_boards(answers: dict) -> Sequence[Tuple[str, str]]:
|
|
|
124
128
|
versions.remove("preview")
|
|
125
129
|
versions.extend((micropython_versions()[-1], micropython_versions()[-2])) # latest preview and stable
|
|
126
130
|
|
|
127
|
-
some_boards = known_stored_boards(answers["port"], versions)
|
|
131
|
+
some_boards = known_stored_boards(answers["port"], versions)
|
|
132
|
+
|
|
133
|
+
# If no boards found and we have specific versions, try fallback
|
|
134
|
+
if not some_boards and versions:
|
|
135
|
+
log.debug(f"No boards found for {answers['port']} with version(s) {versions}, trying fallback")
|
|
136
|
+
|
|
137
|
+
# Get all micropython versions to find fallback candidates
|
|
138
|
+
all_versions = micropython_versions()
|
|
139
|
+
fallback_versions = []
|
|
140
|
+
|
|
141
|
+
for original_version in original_versions:
|
|
142
|
+
if original_version == "stable":
|
|
143
|
+
# For stable, try previous stable versions
|
|
144
|
+
stable_versions = [v for v in all_versions if not v.endswith("preview")]
|
|
145
|
+
# Try the last 3 stable versions
|
|
146
|
+
fallback_versions.extend(stable_versions[-3:])
|
|
147
|
+
elif original_version == "preview":
|
|
148
|
+
# For preview, try current preview and recent stable versions
|
|
149
|
+
preview_versions = [v for v in all_versions if v.endswith("preview")]
|
|
150
|
+
stable_versions = [v for v in all_versions if not v.endswith("preview")]
|
|
151
|
+
fallback_versions.extend(preview_versions[-1:] + stable_versions[-2:])
|
|
152
|
+
else:
|
|
153
|
+
# For specific version, try that version and previous versions
|
|
154
|
+
try:
|
|
155
|
+
version_index = all_versions.index(original_version)
|
|
156
|
+
# Try current and up to 2 previous versions
|
|
157
|
+
start_idx = max(0, version_index - 2)
|
|
158
|
+
fallback_versions.extend(all_versions[start_idx : version_index + 1])
|
|
159
|
+
except ValueError:
|
|
160
|
+
# Version not found in list, try recent stable versions
|
|
161
|
+
stable_versions = [v for v in all_versions if not v.endswith("preview")]
|
|
162
|
+
fallback_versions.extend(stable_versions[-2:])
|
|
163
|
+
|
|
164
|
+
# Remove duplicates and clean versions
|
|
165
|
+
fallback_versions = [clean_version(v) for v in list(set(fallback_versions))]
|
|
166
|
+
|
|
167
|
+
if fallback_versions:
|
|
168
|
+
log.debug(f"Trying fallback versions: {fallback_versions}")
|
|
169
|
+
some_boards = known_stored_boards(answers["port"], fallback_versions)
|
|
128
170
|
|
|
129
171
|
if some_boards:
|
|
130
172
|
# Create a dictionary where the keys are the second elements of the tuples
|
mpflash/basicgit.py
CHANGED
|
@@ -13,17 +13,6 @@ from loguru import logger as log
|
|
|
13
13
|
|
|
14
14
|
from mpflash.config import config
|
|
15
15
|
|
|
16
|
-
# from github import Auth, BadCredentialsException, Github
|
|
17
|
-
|
|
18
|
-
# # Token with no permissions to avoid throttling
|
|
19
|
-
# # https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
|
|
20
|
-
# PAT_NO_ACCESS = "github_pat_" + "11AAHPVFQ0G4NTaQ73Bw5J" + "_fAp7K9sZ1qL8VFnI9g78eUlCdmOXHB3WzSdj2jtEYb4XF3N7PDJBl32qIxq"
|
|
21
|
-
# PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
|
22
|
-
|
|
23
|
-
# # GH_CLIENT = Github(auth=Auth.Token(PAT))
|
|
24
|
-
|
|
25
|
-
# GH_CLIENT = None
|
|
26
|
-
|
|
27
16
|
|
|
28
17
|
def _run_local_git(
|
|
29
18
|
cmd: List[str],
|
mpflash/config.py
CHANGED
|
@@ -100,7 +100,8 @@ class MPFlashConfig:
|
|
|
100
100
|
|
|
101
101
|
# Token with no permissions to avoid throttling
|
|
102
102
|
# https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
|
|
103
|
-
|
|
103
|
+
# mpflash_read_mp_versions - 31-10-2025
|
|
104
|
+
PAT_NO_ACCESS = "github_pat_" + "11AAHPVFQ0qUKF3mRb9iw2" + "_rwgJ0FZUDYftFFyZhilncyVcqhIZaVF4abZxbGgMOhdSTEPUEKEpAM7m2gp"
|
|
104
105
|
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
|
105
106
|
self._gh_client = Github(auth=Auth.Token(PAT))
|
|
106
107
|
return self._gh_client
|
|
Binary file
|
mpflash/list.py
CHANGED
|
@@ -23,7 +23,7 @@ def show_mcus(
|
|
|
23
23
|
|
|
24
24
|
def abbrv_family(family: str, is_wide: bool) -> str:
|
|
25
25
|
if not is_wide:
|
|
26
|
-
ABRV = {"
|
|
26
|
+
ABRV = {"MicroPython": "MPy", "CircuitPython": "CP", "unknown": "?"}
|
|
27
27
|
return ABRV.get(family, family[:4])
|
|
28
28
|
return family
|
|
29
29
|
|
mpflash/logger.py
CHANGED
|
@@ -5,10 +5,6 @@ Ensures log messages are compatible with the current console encoding.
|
|
|
5
5
|
Removes or replaces Unicode icons if the encoding is not UTF-8.
|
|
6
6
|
Prevents Loguru colorization errors with angle bracket notation.
|
|
7
7
|
|
|
8
|
-
Usage for external packages:
|
|
9
|
-
from mpflash.logger import setup_external_logger_safety
|
|
10
|
-
setup_external_logger_safety()
|
|
11
|
-
|
|
12
8
|
This is particularly important when using packages like micropython-stubber
|
|
13
9
|
that may log messages containing angle bracket notation like <board_default>.
|
|
14
10
|
"""
|
|
@@ -110,50 +106,6 @@ def set_loglevel(loglevel: str) -> None:
|
|
|
110
106
|
) # type: ignore
|
|
111
107
|
|
|
112
108
|
|
|
113
|
-
# def configure_safe_logging() -> None:
|
|
114
|
-
# """
|
|
115
|
-
# Configure logging to be safe from colorization errors.
|
|
116
|
-
|
|
117
|
-
# This function helps prevent issues when external packages
|
|
118
|
-
# (like micropython-stubber) log messages with angle brackets
|
|
119
|
-
# that could be misinterpreted as color tags.
|
|
120
|
-
# """
|
|
121
|
-
# # Remove all existing handlers to start fresh
|
|
122
|
-
# try:
|
|
123
|
-
# log.remove()
|
|
124
|
-
# except ValueError:
|
|
125
|
-
# pass
|
|
126
|
-
|
|
127
|
-
# # Add a completely safe handler with no colorization
|
|
128
|
-
# log.add(
|
|
129
|
-
# sys.stderr,
|
|
130
|
-
# level="TRACE",
|
|
131
|
-
# colorize=False, # Completely disable colorization
|
|
132
|
-
# format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {name}:{function}:{line} - {message}",
|
|
133
|
-
# )
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# def setup_external_logger_safety() -> None:
|
|
137
|
-
# """
|
|
138
|
-
# Setup safe logging configuration for external packages.
|
|
139
|
-
|
|
140
|
-
# Call this function before running tools that might log messages
|
|
141
|
-
# with angle bracket notation (like micropython-stubber) to prevent
|
|
142
|
-
# Loguru colorization errors.
|
|
143
|
-
# """
|
|
144
|
-
# import logging
|
|
145
|
-
|
|
146
|
-
# # Configure the root logger to be safe
|
|
147
|
-
# logging.basicConfig(
|
|
148
|
-
# level=logging.DEBUG,
|
|
149
|
-
# format="%(asctime)s | %(levelname)s | %(name)s:%(funcName)s:%(lineno)d - %(message)s",
|
|
150
|
-
# handlers=[logging.StreamHandler(sys.stderr)],
|
|
151
|
-
# )
|
|
152
|
-
|
|
153
|
-
# # Also configure loguru for safety
|
|
154
|
-
# configure_safe_logging()
|
|
155
|
-
|
|
156
|
-
|
|
157
109
|
def make_quiet() -> None:
|
|
158
110
|
"""
|
|
159
111
|
Make the logger quiet.
|
|
@@ -3,6 +3,45 @@ import os
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# our own logging module to avoid dependency on and interfering with logging module
|
|
7
|
+
class logging:
|
|
8
|
+
DEBUG = 10
|
|
9
|
+
INFO = 20
|
|
10
|
+
WARNING = 30
|
|
11
|
+
ERROR = 40
|
|
12
|
+
level = INFO
|
|
13
|
+
prnt = print
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def getLogger(name):
|
|
17
|
+
return logging()
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def basicConfig(cls, level):
|
|
21
|
+
cls.level = level
|
|
22
|
+
|
|
23
|
+
def debug(self, msg):
|
|
24
|
+
if self.level <= logging.DEBUG:
|
|
25
|
+
self.prnt("DEBUG :", msg)
|
|
26
|
+
|
|
27
|
+
def info(self, msg):
|
|
28
|
+
if self.level <= logging.INFO:
|
|
29
|
+
self.prnt("INFO :", msg)
|
|
30
|
+
|
|
31
|
+
def warning(self, msg):
|
|
32
|
+
if self.level <= logging.WARNING:
|
|
33
|
+
self.prnt("WARN :", msg)
|
|
34
|
+
|
|
35
|
+
def error(self, msg):
|
|
36
|
+
if self.level <= logging.ERROR:
|
|
37
|
+
self.prnt("ERROR :", msg)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
log = logging.getLogger("stubber")
|
|
41
|
+
logging.basicConfig(level=logging.INFO)
|
|
42
|
+
# logging.basicConfig(level=logging.DEBUG)
|
|
43
|
+
|
|
44
|
+
|
|
6
45
|
def get_build(s):
|
|
7
46
|
# extract build from sys.version or os.uname().version if available
|
|
8
47
|
# sys.version: 'MicroPython v1.23.0-preview.6.g3d0b6276f'
|
|
@@ -21,74 +60,140 @@ def get_build(s):
|
|
|
21
60
|
return b
|
|
22
61
|
|
|
23
62
|
|
|
24
|
-
def _version_str(version: tuple)
|
|
63
|
+
def _version_str(version: tuple) -> str:
|
|
25
64
|
v_str = ".".join([str(n) for n in version[:3]])
|
|
26
65
|
if len(version) > 3 and version[3]:
|
|
27
66
|
v_str += "-" + version[3]
|
|
28
67
|
return v_str
|
|
29
68
|
|
|
30
69
|
|
|
31
|
-
def
|
|
32
|
-
|
|
70
|
+
def _get_base_system_info() -> dict[str, str]:
|
|
71
|
+
"""Get basic system implementation details."""
|
|
72
|
+
try:
|
|
73
|
+
fam = sys.implementation[0] # type: ignore
|
|
74
|
+
except TypeError:
|
|
75
|
+
# testing on CPython 3.11
|
|
76
|
+
fam = sys.implementation.name
|
|
77
|
+
|
|
33
78
|
info = dict(
|
|
34
79
|
{
|
|
35
|
-
"family":
|
|
80
|
+
"family": fam,
|
|
36
81
|
"version": "",
|
|
37
82
|
"build": "",
|
|
38
83
|
"ver": "",
|
|
39
|
-
"port":
|
|
40
|
-
"board": "
|
|
41
|
-
"
|
|
84
|
+
"port": sys.platform, # port: esp32 / win32 / linux / stm32
|
|
85
|
+
"board": "UNKNOWN",
|
|
86
|
+
"board_id": "",
|
|
87
|
+
"variant": "",
|
|
42
88
|
"cpu": "",
|
|
43
89
|
"mpy": "",
|
|
44
90
|
"arch": "",
|
|
45
91
|
}
|
|
46
92
|
)
|
|
93
|
+
return info
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _normalize_port_info(info: dict[str, str]) -> None:
|
|
97
|
+
"""Normalize port names to be consistent with the repo."""
|
|
98
|
+
if info["port"].startswith("pyb"):
|
|
99
|
+
info["port"] = "stm32"
|
|
100
|
+
elif info["port"] == "win32":
|
|
101
|
+
info["port"] = "windows"
|
|
102
|
+
elif info["port"] == "linux":
|
|
103
|
+
info["port"] = "unix"
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def _extract_version_info(info: dict[str, str]) -> None:
|
|
107
|
+
"""Extract version information from sys.implementation."""
|
|
47
108
|
try:
|
|
48
|
-
info["version"] = _version_str(sys.implementation.version)
|
|
109
|
+
info["version"] = _version_str(sys.implementation.version) # type: ignore
|
|
49
110
|
except AttributeError:
|
|
50
111
|
pass
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def get_boardname(info: dict) -> None:
|
|
115
|
+
"Read the board_id from the boardname.py file that may have been created upfront"
|
|
116
|
+
try:
|
|
117
|
+
from boardname import BOARD_ID # type: ignore
|
|
118
|
+
|
|
119
|
+
log.info("Found BOARD_ID: {}".format(BOARD_ID))
|
|
120
|
+
except ImportError:
|
|
121
|
+
log.warning("BOARD_ID not found")
|
|
122
|
+
BOARD_ID = ""
|
|
123
|
+
info["board_id"] = BOARD_ID
|
|
124
|
+
info["board"] = BOARD_ID.split("-")[0] if "-" in BOARD_ID else BOARD_ID
|
|
125
|
+
info["variant"] == BOARD_ID.split("-")[1] if "-" in BOARD_ID else ""
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _extract_hardware_info(info: dict[str, str]) -> None:
|
|
129
|
+
"""Extract board, CPU, and machine details."""
|
|
51
130
|
try:
|
|
52
131
|
_machine = sys.implementation._machine if "_machine" in dir(sys.implementation) else os.uname().machine # type: ignore
|
|
53
132
|
info["board"] = _machine.strip()
|
|
54
|
-
info["description"] = _machine.strip()
|
|
55
133
|
si_build = sys.implementation._build if "_build" in dir(sys.implementation) else ""
|
|
56
134
|
if si_build:
|
|
57
135
|
info["board"] = si_build.split("-")[0]
|
|
58
136
|
info["variant"] = si_build.split("-")[1] if "-" in si_build else ""
|
|
59
137
|
info["board_id"] = si_build
|
|
60
|
-
info["cpu"] = _machine.split("with")[-1].strip()
|
|
138
|
+
info["cpu"] = _machine.split("with")[-1].strip()
|
|
61
139
|
info["mpy"] = (
|
|
62
|
-
sys.implementation._mpy
|
|
140
|
+
sys.implementation._mpy # type: ignore
|
|
63
141
|
if "_mpy" in dir(sys.implementation)
|
|
64
142
|
else sys.implementation.mpy
|
|
65
143
|
if "mpy" in dir(sys.implementation)
|
|
66
|
-
else ""
|
|
144
|
+
else "" # type: ignore
|
|
67
145
|
)
|
|
68
146
|
except (AttributeError, IndexError):
|
|
69
147
|
pass
|
|
70
148
|
|
|
149
|
+
if not info["board_id"]:
|
|
150
|
+
get_boardname(info)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _build(s):
|
|
154
|
+
# extract build from sys.version or os.uname().version if available
|
|
155
|
+
# sys.version: 'MicroPython v1.24.0-preview.6.g3d0b6276f'
|
|
156
|
+
# sys.implementation.version: 'v1.13-103-gb137d064e'
|
|
157
|
+
if not s:
|
|
158
|
+
return ""
|
|
159
|
+
s = s.split(" on ", 1)[0] if " on " in s else s
|
|
160
|
+
if s.startswith("v"):
|
|
161
|
+
if not "-" in s:
|
|
162
|
+
return ""
|
|
163
|
+
b = s.split("-")[1]
|
|
164
|
+
return b
|
|
165
|
+
if not "-preview" in s:
|
|
166
|
+
return ""
|
|
167
|
+
b = s.split("-preview")[1].split(".")[1]
|
|
168
|
+
return b
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _extract_build_info(info: dict[str, str]) -> None:
|
|
172
|
+
"""Extract build information from various system sources."""
|
|
71
173
|
try:
|
|
72
|
-
if
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
info["build"] = get_build(os.uname()[3]) # type: ignore
|
|
174
|
+
if "uname" in dir(os): # old
|
|
175
|
+
# extract build from uname().version if available
|
|
176
|
+
info["build"] = _build(os.uname()[3]) # type: ignore
|
|
76
177
|
if not info["build"]:
|
|
77
178
|
# extract build from uname().release if available
|
|
78
|
-
info["build"] =
|
|
79
|
-
|
|
179
|
+
info["build"] = _build(os.uname()[2]) # type: ignore
|
|
180
|
+
elif "version" in dir(sys): # new
|
|
181
|
+
# extract build from sys.version if available
|
|
182
|
+
info["build"] = _build(sys.version)
|
|
183
|
+
except (AttributeError, IndexError, TypeError):
|
|
80
184
|
pass
|
|
81
|
-
# avoid build hashes
|
|
82
|
-
if info["build"] and len(info["build"]) > 5:
|
|
83
|
-
info["build"] = ""
|
|
84
185
|
|
|
186
|
+
# Fallback version detection for specific platforms
|
|
85
187
|
if info["version"] == "" and sys.platform not in ("unix", "win32"):
|
|
86
188
|
try:
|
|
87
189
|
u = os.uname() # type: ignore
|
|
88
190
|
info["version"] = u.release
|
|
89
191
|
except (IndexError, AttributeError, TypeError):
|
|
90
192
|
pass
|
|
91
|
-
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def _detect_firmware_family(info: dict[str, str]) -> None:
|
|
196
|
+
"""Detect special firmware families (pycopy, pycom, ev3-pybricks)."""
|
|
92
197
|
for fam_name, mod_name, mod_thing in [
|
|
93
198
|
("pycopy", "pycopy", "const"),
|
|
94
199
|
("pycom", "pycom", "FAT"),
|
|
@@ -105,16 +210,22 @@ def _info(): # type:() -> dict[str, str]
|
|
|
105
210
|
if info["family"] == "ev3-pybricks":
|
|
106
211
|
info["release"] = "2.0.0"
|
|
107
212
|
|
|
213
|
+
|
|
214
|
+
def _process_micropython_version(info: dict[str, str]) -> None:
|
|
215
|
+
"""Process MicroPython-specific version formatting."""
|
|
108
216
|
if info["family"] == "micropython":
|
|
109
217
|
if (
|
|
110
218
|
info["version"]
|
|
111
219
|
and info["version"].endswith(".0")
|
|
112
|
-
and info["version"] >= "1.10.0" # versions from 1.10.0 to 1.
|
|
220
|
+
and info["version"] >= "1.10.0" # versions from 1.10.0 to 1.24.0 do not have a micro .0
|
|
113
221
|
and info["version"] <= "1.19.9"
|
|
114
222
|
):
|
|
115
|
-
#
|
|
223
|
+
# versions from 1.10.0 to 1.24.0 do not have a micro .0
|
|
116
224
|
info["version"] = info["version"][:-2]
|
|
117
225
|
|
|
226
|
+
|
|
227
|
+
def _process_mpy_info(info: dict[str, str]) -> None:
|
|
228
|
+
"""Process MPY architecture and version information."""
|
|
118
229
|
# spell-checker: disable
|
|
119
230
|
if "mpy" in info and info["mpy"]: # mpy on some v1.11+ builds
|
|
120
231
|
sys_mpy = int(info["mpy"])
|
|
@@ -132,20 +243,43 @@ def _info(): # type:() -> dict[str, str]
|
|
|
132
243
|
"armv7emdp",
|
|
133
244
|
"xtensa",
|
|
134
245
|
"xtensawin",
|
|
135
|
-
"
|
|
246
|
+
"rv32imc",
|
|
136
247
|
][sys_mpy >> 10]
|
|
248
|
+
if arch:
|
|
249
|
+
info["arch"] = arch
|
|
137
250
|
except IndexError:
|
|
138
|
-
arch = "unknown"
|
|
139
|
-
if arch:
|
|
140
|
-
info["arch"] = arch
|
|
251
|
+
info["arch"] = "unknown"
|
|
141
252
|
# .mpy version.minor
|
|
142
253
|
info["mpy"] = "v{}.{}".format(sys_mpy & 0xFF, sys_mpy >> 8 & 3)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _format_version_strings(info: dict[str, str]) -> None:
|
|
257
|
+
"""Handle final version string formatting."""
|
|
258
|
+
if info["build"] and not info["version"].endswith("-preview"):
|
|
259
|
+
info["version"] = info["version"] + "-preview"
|
|
260
|
+
# simple to use version[-build] string
|
|
261
|
+
info["ver"] = f"{info['version']}-{info['build']}" if info["build"] else f"{info['version']}"
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def _info(): # type:() -> dict[str, str]
|
|
265
|
+
"""
|
|
266
|
+
Gather comprehensive system information for MicroPython stubbing.
|
|
267
|
+
|
|
268
|
+
Returns a dictionary containing family, version, port, board, and other
|
|
269
|
+
system details needed for stub generation.
|
|
270
|
+
"""
|
|
271
|
+
# Get base system information
|
|
272
|
+
info = _get_base_system_info()
|
|
273
|
+
|
|
274
|
+
# Apply transformations and gather additional info
|
|
275
|
+
_normalize_port_info(info)
|
|
276
|
+
_extract_version_info(info)
|
|
277
|
+
_extract_hardware_info(info)
|
|
278
|
+
_extract_build_info(info)
|
|
279
|
+
_detect_firmware_family(info)
|
|
280
|
+
_process_micropython_version(info)
|
|
281
|
+
_process_mpy_info(info)
|
|
282
|
+
_format_version_strings(info)
|
|
149
283
|
|
|
150
284
|
return info
|
|
151
285
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mpflash
|
|
3
|
-
Version: 1.26.
|
|
3
|
+
Version: 1.26.6
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
mpflash/__init__.py,sha256=tToFcmhcOordC-FrA0Jv3bkyApqZaNjIiqebgzF-s2I,53
|
|
2
|
-
mpflash/ask_input.py,sha256=
|
|
3
|
-
mpflash/basicgit.py,sha256=
|
|
2
|
+
mpflash/ask_input.py,sha256=i46g3ZX5YgxnzUIHjv-onHP-4ML9b43e4G-DrL8qgGA,11539
|
|
3
|
+
mpflash/basicgit.py,sha256=lPoxOx_Y6pOVuNZLeO5wqwPnDnrDRfvw1nJLhBOuzis,9743
|
|
4
4
|
mpflash/cli_add.py,sha256=hI-o-9hAGD3U8cbpXvy9Nuv1KHNTZ6mS57LC4BTBtj8,3495
|
|
5
5
|
mpflash/cli_download.py,sha256=v5aWJIv1bB5cinGa5BL0nS5vJ97dsFXaLpAaKN0RnrU,3528
|
|
6
6
|
mpflash/cli_flash.py,sha256=9SLtDqVrzeYNW6GRLnYrd7Uxh8O6rB4WgM58pjY7Q5k,8799
|
|
@@ -8,12 +8,12 @@ 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
|
-
mpflash/config.py,sha256=
|
|
11
|
+
mpflash/config.py,sha256=52bXcA4rN0l66sup61-NQLs1ZZiXRxY8rxIvLyylT1w,4196
|
|
12
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
|
-
mpflash/list.py,sha256=
|
|
16
|
-
mpflash/logger.py,sha256=
|
|
15
|
+
mpflash/list.py,sha256=RA6xlP6K2LnZT7jTe3Blud-ANuETHt2-YteHZGKCp8k,4131
|
|
16
|
+
mpflash/logger.py,sha256=B3OOQHexHzOAn-YN1NjZ5R0NugKXl4OuezAdr1xzQ5k,3726
|
|
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
|
|
@@ -30,7 +30,7 @@ mpflash/db/core.py,sha256=v9BCXsPwjAwO-bRPM304XFqUv9KTLBJF_NXtGRoJgRI,5243
|
|
|
30
30
|
mpflash/db/gather_boards.py,sha256=C9KL-mdNZw3oukutv_KWFkOJDiFz1mhdShu7lbIpnYs,5494
|
|
31
31
|
mpflash/db/loader.py,sha256=R4pEuXc9jN7v4BMFJKvArnhugniBHsLNZQz6Ijr5W9U,5350
|
|
32
32
|
mpflash/db/meta.py,sha256=2pFTpFH-1zejGIDp2vs0hbX5rqUONt7B1WIvf8qBx5s,2248
|
|
33
|
-
mpflash/db/micropython_boards.zip,sha256=
|
|
33
|
+
mpflash/db/micropython_boards.zip,sha256=I7BH-me3xb2DJvaTLQr7I5HE19SpzpAm23sRyxflYYo,20833
|
|
34
34
|
mpflash/db/models.py,sha256=hZrum-nS-TNFaZAksApjxYMBgGKI_kJ-4oFxc8a4WRk,3572
|
|
35
35
|
mpflash/db/tools.py,sha256=6SEGfshNob4yRQ4h-Cj_xcWMRY28sbA8CWauNXV_uMI,814
|
|
36
36
|
mpflash/download/__init__.py,sha256=3N7cj1To5HqEC2-kGY-jFCwKyrPMrx1SJVTrlqz_7Ow,9420
|
|
@@ -56,7 +56,7 @@ mpflash/mpboard_id/board_info.zip,sha256=-2bnQGRsIQuJUfz-7_-GQ8pMWJ1evhCez6yfjhX
|
|
|
56
56
|
mpflash/mpboard_id/known.py,sha256=t-oREfW5P5Zue5zbte7WB9e7-mpZBF-NfHGTEUsOVLM,3521
|
|
57
57
|
mpflash/mpboard_id/resolve.py,sha256=5KCZ0Tcg3FYZ3HK_zux5EguwoSC2E03kCpW2fh4rN2A,779
|
|
58
58
|
mpflash/mpremoteboard/__init__.py,sha256=vjFwfa3XKDeugkzMDuswYfeImJm3ptQrYr3tIAY02f0,14301
|
|
59
|
-
mpflash/mpremoteboard/mpy_fw_info.py,sha256=
|
|
59
|
+
mpflash/mpremoteboard/mpy_fw_info.py,sha256=SQGqx6DSDKCtBlsWVhZQD7gGmgmRHA8YP9azO7mqa44,9225
|
|
60
60
|
mpflash/mpremoteboard/runner.py,sha256=4-KmWcktsuQfppGZ8iBfz-ov77Pp8v2dVsBKzcLGUtc,5374
|
|
61
61
|
mpflash/vendor/board_database.py,sha256=Cb8fEhJaZ2siMkLPW5rPwV9yzBsTtKGOqWUd9TxNgFM,8763
|
|
62
62
|
mpflash/vendor/click_aliases.py,sha256=adLhqLxNpJEPjSCIRSTkR-QzSgavGFKT0cwRbjxpzRU,5395
|
|
@@ -65,8 +65,8 @@ mpflash/vendor/pydfu.py,sha256=KD1RHHuhvhWi-l1UB6GyggkxouDKtZgkG4ivRbIfwC4,21264
|
|
|
65
65
|
mpflash/vendor/readme.md,sha256=BQ7Uxf8joeYMjTUuSLLBG49ob6a9MgFPIEwuc72-Mfw,415
|
|
66
66
|
mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt,sha256=Zkc2iTNbib2NCMwtLjMEz0vFCPglgvaw6Mj7QiWldpQ,1484
|
|
67
67
|
mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2,sha256=QuPMppqHMVOt3vDVU0bikHRLsTiDRQYNUcGQ_OLRFGI,28160
|
|
68
|
-
mpflash-1.26.
|
|
69
|
-
mpflash-1.26.
|
|
70
|
-
mpflash-1.26.
|
|
71
|
-
mpflash-1.26.
|
|
72
|
-
mpflash-1.26.
|
|
68
|
+
mpflash-1.26.6.dist-info/METADATA,sha256=upTvWhN0LfQZoacxMuUJcBd0Kc8WhH8bikqiRW-KGw4,29201
|
|
69
|
+
mpflash-1.26.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
mpflash-1.26.6.dist-info/entry_points.txt,sha256=DZ24tsMKlCyTkjWet9vCoq5dcFeY43RKtTsLreQI_R8,53
|
|
71
|
+
mpflash-1.26.6.dist-info/licenses/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
|
|
72
|
+
mpflash-1.26.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|