micropython-stubber 1.23.1__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.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/METADATA +30 -13
- {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/RECORD +60 -60
- micropython_stubber-1.23.1.post1.dist-info/entry_points.txt +5 -0
- mpflash/README.md +26 -0
- mpflash/mpflash/cli_download.py +1 -1
- mpflash/mpflash/cli_flash.py +11 -14
- mpflash/mpflash/cli_list.py +8 -2
- mpflash/mpflash/common.py +2 -1
- mpflash/mpflash/connected.py +2 -3
- mpflash/mpflash/list.py +20 -13
- mpflash/mpflash/mpremoteboard/__init__.py +50 -6
- mpflash/pyproject.toml +1 -1
- stubber/bulk/mcu_stubber.py +28 -45
- stubber/codemod/enrich.py +1 -1
- stubber/codemod/merge_docstub.py +1 -1
- stubber/commands/build_cmd.py +1 -1
- stubber/commands/cli.py +5 -11
- stubber/commands/clone_cmd.py +1 -1
- 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 +5 -2
- stubber/commands/get_frozen_cmd.py +5 -2
- stubber/commands/get_mcu_cmd.py +52 -11
- stubber/commands/merge_cmd.py +1 -1
- stubber/commands/publish_cmd.py +1 -1
- stubber/commands/stub_cmd.py +1 -1
- stubber/commands/variants_cmd.py +1 -1
- 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 +7 -3
- stubber/get_cpython.py +15 -4
- stubber/minify.py +7 -3
- stubber/publish/candidates.py +26 -7
- stubber/publish/merge_docstubs.py +4 -2
- stubber/publish/missing_class_methods.py +4 -2
- stubber/publish/package.py +7 -3
- stubber/publish/pathnames.py +1 -1
- stubber/publish/publish.py +1 -1
- stubber/publish/pypi.py +6 -2
- stubber/publish/stubpackage.py +40 -16
- stubber/rst/classsort.py +2 -1
- stubber/rst/lookup.py +1 -0
- stubber/rst/reader.py +7 -7
- 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 -1
- stubber/update_fallback.py +1 -1
- stubber/update_module_list.py +1 -1
- stubber/utils/config.py +19 -7
- stubber/utils/post.py +2 -1
- stubber/utils/repos.py +9 -3
- stubber/utils/stubmaker.py +1 -1
- stubber/utils/typed_config_toml.py +5 -2
- stubber/variants.py +1 -1
- micropython_stubber-1.23.1.dist-info/entry_points.txt +0 -3
- {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/WHEEL +0 -0
stubber/utils/post.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
"""Pre/Post Processing for createstubs.py"""
|
2
|
+
|
2
3
|
import subprocess
|
3
4
|
import sys
|
4
5
|
from pathlib import Path
|
5
6
|
from typing import List
|
6
7
|
|
7
8
|
import autoflake
|
8
|
-
from
|
9
|
+
from mpflash.logger import log
|
9
10
|
|
10
11
|
from .stubmaker import generate_pyi_files
|
11
12
|
|
stubber/utils/repos.py
CHANGED
@@ -8,7 +8,7 @@ from collections import defaultdict
|
|
8
8
|
from pathlib import Path
|
9
9
|
from typing import Tuple
|
10
10
|
|
11
|
-
from
|
11
|
+
from mpflash.logger import log
|
12
12
|
from packaging.version import Version
|
13
13
|
|
14
14
|
import mpflash.basicgit as git
|
@@ -63,7 +63,11 @@ def read_micropython_lib_commits(filename: str = "data/micropython_tags.csv"):
|
|
63
63
|
reader = csv.DictReader(ntf.file, skipinitialspace=True) # dialect="excel",
|
64
64
|
rows = list(reader)
|
65
65
|
# create a dict version --> commit_hash
|
66
|
-
version_commit = {
|
66
|
+
version_commit = {
|
67
|
+
row["version"].split("/")[-1]: row["lib_commit_hash"]
|
68
|
+
for row in rows
|
69
|
+
if row["version"].startswith("refs/tags/")
|
70
|
+
}
|
67
71
|
# add default
|
68
72
|
version_commit = defaultdict(lambda: "master", version_commit)
|
69
73
|
return version_commit
|
@@ -91,7 +95,9 @@ def match_lib_with_mpy(version_tag: str, mpy_path: Path, lib_path: Path) -> bool
|
|
91
95
|
return False
|
92
96
|
return git.sync_submodules(mpy_path)
|
93
97
|
else:
|
94
|
-
log.info(
|
98
|
+
log.info(
|
99
|
+
f"Matching repo's: Micropython {version_tag} needs micropython-lib:{micropython_lib_commits[version_tag]}"
|
100
|
+
)
|
95
101
|
return git.checkout_commit(micropython_lib_commits[version_tag], lib_path)
|
96
102
|
|
97
103
|
|
stubber/utils/stubmaker.py
CHANGED
@@ -4,6 +4,7 @@ typed-config-toml
|
|
4
4
|
Extend typed-config to read configuration from .toml files
|
5
5
|
|
6
6
|
"""
|
7
|
+
|
7
8
|
# TODO : extend support for . notation in section names
|
8
9
|
|
9
10
|
from pathlib import Path
|
@@ -15,7 +16,7 @@ except ModuleNotFoundError:
|
|
15
16
|
import tomli as tomllib # type: ignore
|
16
17
|
assert tomllib
|
17
18
|
|
18
|
-
from
|
19
|
+
from mpflash.logger import log
|
19
20
|
from typedconfig.source import ConfigSource
|
20
21
|
|
21
22
|
|
@@ -69,7 +70,9 @@ class TomlConfigSource(ConfigSource):
|
|
69
70
|
# do not assume/require that all values are strings
|
70
71
|
# assert isinstance(v_v, str)
|
71
72
|
# Convert all keys to lowercase
|
72
|
-
self.data = {
|
73
|
+
self.data = {
|
74
|
+
k.lower(): {v_k.lower(): v_v for v_k, v_v in v.items()} for k, v in self.data.items()
|
75
|
+
}
|
73
76
|
|
74
77
|
def get_config_value(self, section_name: str, key_name: str) -> Optional[str]:
|
75
78
|
# Extract info from data which we read in during __init__
|
stubber/variants.py
CHANGED
@@ -10,7 +10,7 @@ from typing import List, Optional
|
|
10
10
|
|
11
11
|
import libcst as cst
|
12
12
|
import libcst.codemod as codemod
|
13
|
-
from
|
13
|
+
from mpflash.logger import log
|
14
14
|
|
15
15
|
from stubber.codemod.board import CreateStubsCodemod, CreateStubsVariant
|
16
16
|
from stubber.codemod.modify_list import ListChangeSet # type: ignore
|
File without changes
|
File without changes
|