micropython-stubber 1.23.0__py3-none-any.whl → 1.23.1.post1__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.
- {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.post1.dist-info}/METADATA +32 -14
- micropython_stubber-1.23.1.post1.dist-info/RECORD +159 -0
- micropython_stubber-1.23.1.post1.dist-info/entry_points.txt +5 -0
- mpflash/README.md +40 -4
- mpflash/mpflash/add_firmware.py +1 -1
- mpflash/mpflash/ask_input.py +1 -1
- {stubber → mpflash/mpflash}/basicgit.py +3 -13
- mpflash/mpflash/bootloader/__init__.py +2 -37
- mpflash/mpflash/bootloader/activate.py +60 -0
- mpflash/mpflash/bootloader/detect.py +82 -0
- mpflash/mpflash/bootloader/manual.py +10 -11
- mpflash/mpflash/bootloader/micropython.py +2 -0
- mpflash/mpflash/bootloader/touch1200.py +13 -22
- mpflash/mpflash/cli_download.py +2 -2
- mpflash/mpflash/cli_flash.py +13 -16
- mpflash/mpflash/cli_group.py +18 -5
- mpflash/mpflash/cli_list.py +8 -2
- mpflash/mpflash/cli_main.py +3 -5
- mpflash/mpflash/common.py +3 -1
- mpflash/mpflash/config.py +2 -1
- mpflash/mpflash/connected.py +11 -8
- mpflash/mpflash/download.py +9 -5
- mpflash/mpflash/downloaded.py +1 -1
- mpflash/mpflash/{flash.py → flash/__init__.py} +3 -3
- mpflash/mpflash/{flash_esp.py → flash/esp.py} +1 -1
- mpflash/mpflash/{flash_stm32.py → flash/stm32.py} +4 -3
- mpflash/mpflash/{flash_stm32_dfu.py → flash/stm32_dfu.py} +1 -1
- mpflash/mpflash/{flash_uf2.py → flash/uf2/__init__.py} +19 -20
- mpflash/mpflash/{flash_uf2_linux.py → flash/uf2/linux.py} +12 -11
- mpflash/mpflash/{flash_uf2_macos.py → flash/uf2/macos.py} +11 -6
- mpflash/mpflash/{flash_uf2_windows.py → flash/uf2/windows.py} +11 -6
- mpflash/mpflash/{worklist.py → flash/worklist.py} +8 -9
- mpflash/mpflash/list.py +26 -9
- mpflash/mpflash/mpboard_id/__init__.py +1 -1
- mpflash/mpflash/mpboard_id/add_boards.py +3 -7
- mpflash/mpflash/mpboard_id/board_id.py +1 -1
- mpflash/mpflash/mpremoteboard/__init__.py +57 -17
- {stubber/utils → mpflash/mpflash}/versions.py +31 -24
- mpflash/poetry.lock +16 -5
- mpflash/pyproject.toml +4 -3
- stubber/__init__.py +1 -1
- stubber/board/createstubs.py +4 -4
- stubber/board/createstubs_db.py +5 -5
- stubber/board/createstubs_db_min.py +1 -1
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +5 -5
- stubber/board/createstubs_mem_min.py +1 -1
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +1 -1
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/bulk/mcu_stubber.py +28 -45
- stubber/codemod/enrich.py +1 -1
- stubber/codemod/merge_docstub.py +1 -1
- stubber/codemod/utils.py +2 -3
- stubber/commands/build_cmd.py +1 -1
- stubber/commands/cli.py +6 -12
- stubber/commands/clone_cmd.py +3 -2
- stubber/commands/config_cmd.py +1 -1
- stubber/commands/enrich_folder_cmd.py +1 -1
- stubber/commands/get_core_cmd.py +1 -1
- stubber/commands/get_docstubs_cmd.py +6 -3
- stubber/commands/get_frozen_cmd.py +6 -3
- stubber/commands/get_mcu_cmd.py +53 -12
- stubber/commands/merge_cmd.py +2 -3
- stubber/commands/publish_cmd.py +2 -3
- stubber/commands/stub_cmd.py +1 -1
- stubber/commands/switch_cmd.py +2 -2
- stubber/commands/variants_cmd.py +2 -3
- stubber/downloader.py +2 -1
- stubber/freeze/common.py +7 -3
- stubber/freeze/freeze_folder.py +2 -2
- stubber/freeze/freeze_manifest_2.py +19 -6
- stubber/freeze/get_frozen.py +8 -4
- stubber/get_cpython.py +15 -4
- stubber/minify.py +11 -6
- stubber/publish/candidates.py +20 -7
- stubber/publish/defaults.py +4 -9
- stubber/publish/merge_docstubs.py +4 -2
- stubber/publish/missing_class_methods.py +5 -3
- stubber/publish/package.py +8 -4
- stubber/publish/pathnames.py +2 -2
- stubber/publish/publish.py +2 -2
- stubber/publish/pypi.py +6 -2
- stubber/publish/stubpackage.py +39 -17
- stubber/rst/classsort.py +2 -1
- stubber/rst/lookup.py +1 -0
- stubber/rst/reader.py +12 -20
- stubber/rst/report_return.py +12 -4
- stubber/rst/rst_utils.py +2 -1
- stubber/stubs_from_docs.py +1 -1
- stubber/tools/manifestfile.py +1 -2
- stubber/update_fallback.py +2 -2
- stubber/update_module_list.py +1 -1
- stubber/utils/__init__.py +2 -1
- stubber/utils/config.py +18 -8
- stubber/utils/manifest.py +2 -4
- stubber/utils/post.py +2 -1
- stubber/utils/repos.py +4 -5
- stubber/utils/stubmaker.py +1 -1
- stubber/utils/typed_config_toml.py +5 -2
- stubber/variants.py +1 -1
- micropython_stubber-1.23.0.dist-info/RECORD +0 -159
- micropython_stubber-1.23.0.dist-info/entry_points.txt +0 -3
- mpflash/mpflash/flash_stm32_cube.py +0 -111
- mpflash/mpflash/vendor/versions.py +0 -119
- {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.post1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.post1.dist-info}/WHEEL +0 -0
- /mpflash/{mpflash/vendor/basicgit.py → basicgit.py} +0 -0
- /mpflash/mpflash/{flash_uf2_boardid.py → flash/uf2/boardid.py} +0 -0
- /mpflash/mpflash/{uf2disk.py → flash/uf2/uf2disk.py} +0 -0
@@ -1,119 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
#############################################################
|
3
|
-
# Version handling copied from stubber/utils/versions.py
|
4
|
-
#############################################################
|
5
|
-
"""
|
6
|
-
|
7
|
-
from functools import lru_cache
|
8
|
-
|
9
|
-
from loguru import logger as log
|
10
|
-
from packaging.version import parse
|
11
|
-
|
12
|
-
from mpflash.common import GH_CLIENT
|
13
|
-
OLDEST_VERSION = "1.16"
|
14
|
-
"This is the oldest MicroPython version to build the stubs on"
|
15
|
-
|
16
|
-
V_PREVIEW = "preview"
|
17
|
-
"Latest preview version"
|
18
|
-
|
19
|
-
SET_PREVIEW = {"preview", "latest", "master"}
|
20
|
-
|
21
|
-
|
22
|
-
def clean_version(
|
23
|
-
version: str,
|
24
|
-
*,
|
25
|
-
build: bool = False,
|
26
|
-
patch: bool = False,
|
27
|
-
commit: bool = False,
|
28
|
-
drop_v: bool = False,
|
29
|
-
flat: bool = False,
|
30
|
-
):
|
31
|
-
"Clean up and transform the many flavours of versions"
|
32
|
-
# 'v1.13.0-103-gb137d064e' --> 'v1.13-103'
|
33
|
-
if version in {"", "-"}:
|
34
|
-
return version
|
35
|
-
if version.lower() == "stable":
|
36
|
-
_v = get_stable_mp_version()
|
37
|
-
if not _v:
|
38
|
-
log.warning("Could not determine the latest stable version")
|
39
|
-
return "stable"
|
40
|
-
version = _v
|
41
|
-
log.trace(f"Using latest stable version: {version}")
|
42
|
-
is_preview = "-preview" in version
|
43
|
-
nibbles = version.split("-")
|
44
|
-
ver_ = nibbles[0].lower().lstrip("v")
|
45
|
-
if not patch and ver_ >= "1.10.0" and ver_ < "1.20.0" and ver_.endswith(".0"):
|
46
|
-
# remove the last ".0" - but only for versions between 1.10 and 1.20 (because)
|
47
|
-
nibbles[0] = nibbles[0][:-2]
|
48
|
-
if len(nibbles) == 1:
|
49
|
-
version = nibbles[0]
|
50
|
-
elif build and not is_preview:
|
51
|
-
version = "-".join(nibbles) if commit else "-".join(nibbles[:-1])
|
52
|
-
else:
|
53
|
-
# version = "-".join((nibbles[0], LATEST))
|
54
|
-
# HACK: this is not always right, but good enough most of the time
|
55
|
-
if is_preview:
|
56
|
-
version = "-".join((nibbles[0], V_PREVIEW))
|
57
|
-
else:
|
58
|
-
version = V_PREVIEW
|
59
|
-
if flat:
|
60
|
-
version = version.strip().replace(".", "_").replace("-", "_")
|
61
|
-
else:
|
62
|
-
version = version.strip().replace("_preview", "-preview").replace("_", ".")
|
63
|
-
|
64
|
-
if drop_v:
|
65
|
-
version = version.lstrip("v")
|
66
|
-
elif not version.startswith("v") and version.lower() not in SET_PREVIEW:
|
67
|
-
version = "v" + version
|
68
|
-
if version in SET_PREVIEW:
|
69
|
-
version = V_PREVIEW
|
70
|
-
return version
|
71
|
-
|
72
|
-
|
73
|
-
@lru_cache(maxsize=10)
|
74
|
-
def micropython_versions(minver: str = "v1.20", reverse: bool = False):
|
75
|
-
"""Get the list of micropython versions from github tags"""
|
76
|
-
try:
|
77
|
-
gh_client = GH_CLIENT
|
78
|
-
repo = gh_client.get_repo("micropython/micropython")
|
79
|
-
versions = [tag.name for tag in repo.get_tags() if parse(tag.name) >= parse(minver)]
|
80
|
-
# Only keep the last preview
|
81
|
-
versions = [v for v in versions if not v.endswith(V_PREVIEW) or v == versions[-1]]
|
82
|
-
except Exception:
|
83
|
-
versions = [
|
84
|
-
"v9.99.9-preview",
|
85
|
-
"v1.22.2",
|
86
|
-
"v1.22.1",
|
87
|
-
"v1.22.0",
|
88
|
-
"v1.21.1",
|
89
|
-
"v1.21.0",
|
90
|
-
"v1.20.0",
|
91
|
-
"v1.19.1",
|
92
|
-
"v1.19",
|
93
|
-
"v1.18",
|
94
|
-
"v1.17",
|
95
|
-
"v1.16",
|
96
|
-
"v1.15",
|
97
|
-
"v1.14",
|
98
|
-
"v1.13",
|
99
|
-
"v1.12",
|
100
|
-
"v1.11",
|
101
|
-
"v1.10",
|
102
|
-
]
|
103
|
-
versions = [v for v in versions if parse(v) >= parse(minver)]
|
104
|
-
# remove all but the most recent (preview) version
|
105
|
-
versions = versions[:1] + [v for v in versions if "preview" not in v]
|
106
|
-
return sorted(versions, reverse=reverse)
|
107
|
-
|
108
|
-
|
109
|
-
def get_stable_mp_version() -> str:
|
110
|
-
# read the versions from the git tags
|
111
|
-
all_versions = micropython_versions(minver=OLDEST_VERSION)
|
112
|
-
return [v for v in all_versions if not v.endswith(V_PREVIEW)][-1]
|
113
|
-
|
114
|
-
|
115
|
-
def get_preview_mp_version() -> str:
|
116
|
-
# read the versions from the git tags
|
117
|
-
all_versions = micropython_versions(minver=OLDEST_VERSION)
|
118
|
-
return [v for v in all_versions if v.endswith(V_PREVIEW)][-1]
|
119
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|