micropython-stubber 1.23.3__py3-none-any.whl → 1.24.1__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.3.dist-info → micropython_stubber-1.24.1.dist-info}/METADATA +29 -11
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/RECORD +68 -65
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/WHEEL +1 -1
- mpflash/README.md +2 -2
- mpflash/mpflash/basicgit.py +22 -2
- mpflash/mpflash/common.py +23 -13
- mpflash/mpflash/downloaded.py +10 -2
- mpflash/mpflash/flash/esp.py +1 -1
- mpflash/mpflash/mpboard_id/__init__.py +9 -4
- mpflash/mpflash/mpboard_id/add_boards.py +25 -14
- mpflash/mpflash/mpboard_id/board.py +2 -2
- mpflash/mpflash/mpboard_id/board_id.py +10 -6
- mpflash/mpflash/mpboard_id/board_info.zip +0 -0
- mpflash/mpflash/mpremoteboard/__init__.py +13 -8
- mpflash/mpflash/vendor/board_database.py +185 -0
- mpflash/mpflash/vendor/readme.md +10 -1
- mpflash/mpflash/versions.py +28 -40
- mpflash/poetry.lock +1147 -231
- mpflash/pyproject.toml +4 -3
- stubber/__init__.py +1 -1
- stubber/board/createstubs.py +76 -34
- stubber/board/createstubs_db.py +34 -25
- stubber/board/createstubs_db_min.py +90 -83
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +34 -25
- stubber/board/createstubs_mem_min.py +123 -116
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +154 -145
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/modulelist.txt +16 -0
- stubber/codemod/enrich.py +301 -86
- stubber/codemod/merge_docstub.py +251 -66
- stubber/codemod/test_enrich.py +87 -0
- stubber/codemod/visitors/type_helpers.py +182 -0
- stubber/commands/build_cmd.py +16 -3
- stubber/commands/clone_cmd.py +3 -3
- stubber/commands/config_cmd.py +4 -2
- stubber/commands/enrich_folder_cmd.py +33 -21
- stubber/commands/get_core_cmd.py +1 -2
- stubber/commands/get_docstubs_cmd.py +60 -6
- stubber/commands/get_frozen_cmd.py +15 -12
- stubber/commands/get_mcu_cmd.py +3 -3
- stubber/commands/merge_cmd.py +1 -2
- stubber/commands/publish_cmd.py +19 -4
- stubber/commands/stub_cmd.py +3 -3
- stubber/commands/switch_cmd.py +3 -5
- stubber/commands/variants_cmd.py +3 -3
- stubber/cst_transformer.py +52 -17
- stubber/freeze/common.py +27 -11
- stubber/freeze/freeze_manifest_2.py +8 -1
- stubber/freeze/get_frozen.py +4 -1
- stubber/merge_config.py +111 -0
- stubber/minify.py +1 -2
- stubber/publish/database.py +51 -10
- stubber/publish/merge_docstubs.py +38 -17
- stubber/publish/package.py +32 -18
- stubber/publish/publish.py +8 -8
- stubber/publish/stubpackage.py +117 -50
- stubber/rst/lookup.py +205 -41
- stubber/rst/reader.py +106 -59
- stubber/rst/rst_utils.py +24 -11
- stubber/stubber.py +1 -1
- stubber/stubs_from_docs.py +31 -13
- stubber/update_module_list.py +2 -2
- stubber/utils/config.py +33 -13
- stubber/utils/post.py +9 -6
- stubber/publish/missing_class_methods.py +0 -51
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.23.3.dist-info → micropython_stubber-1.24.1.dist-info}/entry_points.txt +0 -0
mpflash/pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "mpflash"
|
3
|
-
version = "1.
|
3
|
+
version = "1.24.6"
|
4
4
|
description = "Flash and download tool for MicroPython firmwares"
|
5
5
|
authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
|
6
6
|
license = "MIT"
|
@@ -18,6 +18,7 @@ classifiers = [
|
|
18
18
|
mpflash = "mpflash.cli_main:mpflash"
|
19
19
|
|
20
20
|
[tool.poetry.dependencies]
|
21
|
+
python = ">=3.9,<4.0"
|
21
22
|
beautifulsoup4 = "^4.12.3"
|
22
23
|
bincopy = "^20.0.0"
|
23
24
|
blkinfo = "^0.2.0"
|
@@ -29,16 +30,16 @@ jsons = "^1.6.3"
|
|
29
30
|
libusb = { version = "^1.0.27", platform = "win32" }
|
30
31
|
loguru = "^0.7.2"
|
31
32
|
mpremote = "^1.22.0"
|
32
|
-
packaging = "
|
33
|
+
packaging = "^24.2"
|
33
34
|
platformdirs = "^4.2.0"
|
34
35
|
psutil = "^5.9.8"
|
35
36
|
pygithub = "^2.1.1"
|
36
|
-
python = ">=3.8.1,<4.0"
|
37
37
|
pyusb = "^1.2.1"
|
38
38
|
requests = "^2.31.0"
|
39
39
|
rich-click = "^1.8.1"
|
40
40
|
tenacity = "8.2.3"
|
41
41
|
cache-to-disk = "^2.0.0"
|
42
|
+
poetry = "^2.0.1"
|
42
43
|
|
43
44
|
|
44
45
|
[tool.poetry.group.dev]
|
stubber/__init__.py
CHANGED
stubber/board/createstubs.py
CHANGED
@@ -24,7 +24,7 @@ try:
|
|
24
24
|
except ImportError:
|
25
25
|
from ucollections import OrderedDict # type: ignore
|
26
26
|
|
27
|
-
__version__ = "v1.
|
27
|
+
__version__ = "v1.24.0"
|
28
28
|
ENOENT = 2
|
29
29
|
_MAX_CLASS_LEVEL = 2 # Max class nesting
|
30
30
|
LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
|
@@ -32,7 +32,7 @@ LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
|
|
32
32
|
|
33
33
|
# our own logging module to avoid dependency on and interfering with logging module
|
34
34
|
class logging:
|
35
|
-
|
35
|
+
DEBUG = 10
|
36
36
|
INFO = 20
|
37
37
|
WARNING = 30
|
38
38
|
ERROR = 40
|
@@ -47,9 +47,9 @@ class logging:
|
|
47
47
|
def basicConfig(cls, level):
|
48
48
|
cls.level = level
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
def debug(self, msg):
|
51
|
+
if self.level <= logging.DEBUG:
|
52
|
+
self.prnt("DEBUG :", msg)
|
53
53
|
|
54
54
|
def info(self, msg):
|
55
55
|
if self.level <= logging.INFO:
|
@@ -152,7 +152,11 @@ class Stubber:
|
|
152
152
|
order = 4
|
153
153
|
_result.append((name, repr(val), repr(type(val)), val, order))
|
154
154
|
except AttributeError as e:
|
155
|
-
_errors.append(
|
155
|
+
_errors.append(
|
156
|
+
"Couldn't get attribute '{}' from object '{}', Err: {}".format(
|
157
|
+
name, item_instance, e
|
158
|
+
)
|
159
|
+
)
|
156
160
|
except MemoryError as e:
|
157
161
|
print("MemoryError: {}".format(e))
|
158
162
|
sleep(1)
|
@@ -218,13 +222,16 @@ class Stubber:
|
|
218
222
|
try:
|
219
223
|
new_module = __import__(module_name, None, None, ("*"))
|
220
224
|
m1 = gc.mem_free() # type: ignore
|
221
|
-
log.info(
|
225
|
+
log.info(
|
226
|
+
"Stub module: {:<25} to file: {:<70} mem:{:>5}".format(module_name, fname, m1)
|
227
|
+
)
|
222
228
|
|
223
229
|
except ImportError:
|
224
230
|
# log.debug("Skip module: {:<25} {:<79}".format(module_name, "Module not found."))
|
225
231
|
return False
|
226
232
|
|
227
233
|
# Start a new file
|
234
|
+
# log.debug("Create file: {}".format(file_name))
|
228
235
|
ensure_folder(file_name)
|
229
236
|
with open(file_name, "w") as fp:
|
230
237
|
info_ = str(self.info).replace("OrderedDict(", "").replace("})", "}")
|
@@ -249,7 +256,9 @@ class Stubber:
|
|
249
256
|
gc.collect()
|
250
257
|
return True
|
251
258
|
|
252
|
-
def write_object_stub(
|
259
|
+
def write_object_stub(
|
260
|
+
self, fp, object_expr: object, obj_name: str, indent: str, in_class: int = 0
|
261
|
+
):
|
253
262
|
"Write a module/object stub to an open file. Can be called recursive."
|
254
263
|
gc.collect()
|
255
264
|
if object_expr in self.problematic:
|
@@ -325,11 +334,13 @@ class Stubber:
|
|
325
334
|
first = "self, "
|
326
335
|
# class method - add function decoration
|
327
336
|
if "bound_method" in item_type_txt or "bound_method" in item_repr:
|
328
|
-
s = "{}@classmethod\n".format(
|
329
|
-
indent
|
330
|
-
)
|
337
|
+
s = "{}@classmethod\n".format(
|
338
|
+
indent
|
339
|
+
) + "{}def {}(cls, *args, **kwargs) -> {}:\n".format(indent, item_name, ret)
|
331
340
|
else:
|
332
|
-
s = "{}def {}({}*args, **kwargs) -> {}:\n".format(
|
341
|
+
s = "{}def {}({}*args, **kwargs) -> {}:\n".format(
|
342
|
+
indent, item_name, first, ret
|
343
|
+
)
|
333
344
|
s += indent + " ...\n\n"
|
334
345
|
fp.write(s)
|
335
346
|
# log.debug("\n" + s)
|
@@ -344,8 +355,10 @@ class Stubber:
|
|
344
355
|
|
345
356
|
if t in ("str", "int", "float", "bool", "bytearray", "bytes"):
|
346
357
|
# known type: use actual value
|
347
|
-
|
348
|
-
|
358
|
+
if item_name.upper() == item_name: # ALL_CAPS --> Final
|
359
|
+
s = "{0}{1}: Final[{3}] = {2}\n".format(indent, item_name, item_repr, t)
|
360
|
+
else:
|
361
|
+
s = "{0}{1}: {3} = {2}\n".format(indent, item_name, item_repr, t)
|
349
362
|
elif t in ("dict", "list", "tuple"):
|
350
363
|
# dict, list , tuple: use empty value
|
351
364
|
ev = {"dict": "{}", "list": "[]", "tuple": "()"}
|
@@ -358,7 +371,9 @@ class Stubber:
|
|
358
371
|
# use these types for the attribute
|
359
372
|
if t == "generator":
|
360
373
|
t = "Generator"
|
361
|
-
s = "{0}{1}: {2} ## = {4}\n".format(
|
374
|
+
s = "{0}{1}: {2} ## = {4}\n".format(
|
375
|
+
indent, item_name, t, item_type_txt, item_repr
|
376
|
+
)
|
362
377
|
else:
|
363
378
|
# Requires Python 3.6 syntax, which is OK for the stubs/pyi
|
364
379
|
t = "Incomplete"
|
@@ -366,7 +381,9 @@ class Stubber:
|
|
366
381
|
item_repr = item_repr.split(" at ")[0] + " at ...>"
|
367
382
|
if " at " in item_repr:
|
368
383
|
item_repr = item_repr.split(" at ")[0] + " at ...>"
|
369
|
-
s = "{0}{1}: {2} ## {3} = {4}\n".format(
|
384
|
+
s = "{0}{1}: {2} ## {3} = {4}\n".format(
|
385
|
+
indent, item_name, t, item_type_txt, item_repr
|
386
|
+
)
|
370
387
|
fp.write(s)
|
371
388
|
# log.debug("\n" + s)
|
372
389
|
else:
|
@@ -449,7 +466,9 @@ class Stubber:
|
|
449
466
|
f.write(",\n")
|
450
467
|
else:
|
451
468
|
self._json_first = False
|
452
|
-
line = '{{"module": "{}", "file": "{}"}}'.format(
|
469
|
+
line = '{{"module": "{}", "file": "{}"}}'.format(
|
470
|
+
module_name, stub_file.replace("\\", "/")
|
471
|
+
)
|
453
472
|
f.write(line)
|
454
473
|
|
455
474
|
except OSError:
|
@@ -478,6 +497,7 @@ def ensure_folder(path: str):
|
|
478
497
|
# folder does not exist
|
479
498
|
if e.args[0] == ENOENT:
|
480
499
|
try:
|
500
|
+
log.debug("Create folder {}".format(p))
|
481
501
|
os.mkdir(p)
|
482
502
|
except OSError as e2:
|
483
503
|
log.error("failed to create folder {}".format(p))
|
@@ -488,7 +508,7 @@ def ensure_folder(path: str):
|
|
488
508
|
|
489
509
|
def _build(s):
|
490
510
|
# extract build from sys.version or os.uname().version if available
|
491
|
-
# sys.version: 'MicroPython v1.
|
511
|
+
# sys.version: 'MicroPython v1.24.0-preview.6.g3d0b6276f'
|
492
512
|
# sys.implementation.version: 'v1.13-103-gb137d064e'
|
493
513
|
if not s:
|
494
514
|
return ""
|
@@ -595,29 +615,34 @@ def _info(): # type:() -> dict[str, str]
|
|
595
615
|
if (
|
596
616
|
info["version"]
|
597
617
|
and info["version"].endswith(".0")
|
598
|
-
and info["version"]
|
618
|
+
and info["version"]
|
619
|
+
>= "1.10.0" # versions from 1.10.0 to 1.24.0 do not have a micro .0
|
599
620
|
and info["version"] <= "1.19.9"
|
600
621
|
):
|
601
|
-
# versions from 1.10.0 to 1.
|
622
|
+
# versions from 1.10.0 to 1.24.0 do not have a micro .0
|
602
623
|
info["version"] = info["version"][:-2]
|
603
624
|
|
604
625
|
# spell-checker: disable
|
605
626
|
if "mpy" in info and info["mpy"]: # mpy on some v1.11+ builds
|
606
627
|
sys_mpy = int(info["mpy"])
|
607
628
|
# .mpy architecture
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
629
|
+
try:
|
630
|
+
arch = [
|
631
|
+
None,
|
632
|
+
"x86",
|
633
|
+
"x64",
|
634
|
+
"armv6",
|
635
|
+
"armv6m",
|
636
|
+
"armv7m",
|
637
|
+
"armv7em",
|
638
|
+
"armv7emsp",
|
639
|
+
"armv7emdp",
|
640
|
+
"xtensa",
|
641
|
+
"xtensawin",
|
642
|
+
"rv32imc",
|
643
|
+
][sys_mpy >> 10]
|
644
|
+
except IndexError:
|
645
|
+
arch = "unknown"
|
621
646
|
if arch:
|
622
647
|
info["arch"] = arch
|
623
648
|
# .mpy version.minor
|
@@ -657,7 +682,7 @@ def get_root() -> str: # sourcery skip: use-assigned-variable
|
|
657
682
|
# unix port
|
658
683
|
c = "."
|
659
684
|
r = c
|
660
|
-
for r in ["/sd", "/flash", "/", c, "."]:
|
685
|
+
for r in ["/remote", "/sd", "/flash", "/", c, "."]:
|
661
686
|
try:
|
662
687
|
_ = os.stat(r)
|
663
688
|
break
|
@@ -801,6 +826,8 @@ def main():
|
|
801
826
|
"breakout_trackball",
|
802
827
|
"breakout_vl53l5cx",
|
803
828
|
"btree",
|
829
|
+
"builtins",
|
830
|
+
"cc3200",
|
804
831
|
"cmath",
|
805
832
|
"collections",
|
806
833
|
"crypto",
|
@@ -811,10 +838,12 @@ def main():
|
|
811
838
|
"display",
|
812
839
|
"display_driver_utils",
|
813
840
|
"ds18x20",
|
841
|
+
"embed",
|
814
842
|
"encoder",
|
815
843
|
"errno",
|
816
844
|
"esp",
|
817
845
|
"esp32",
|
846
|
+
"esp8266",
|
818
847
|
"espidf",
|
819
848
|
"espnow",
|
820
849
|
"ffi",
|
@@ -849,11 +878,13 @@ def main():
|
|
849
878
|
"lvgl",
|
850
879
|
"lwip",
|
851
880
|
"machine",
|
881
|
+
"marshal",
|
852
882
|
"math",
|
853
883
|
"microWebSocket",
|
854
884
|
"microWebSrv",
|
855
885
|
"microWebTemplate",
|
856
886
|
"micropython",
|
887
|
+
"mimxrt",
|
857
888
|
"mip",
|
858
889
|
"mip/__init__",
|
859
890
|
"mip/__main__",
|
@@ -862,11 +893,13 @@ def main():
|
|
862
893
|
"mpu9250",
|
863
894
|
"neopixel",
|
864
895
|
"network",
|
896
|
+
"nrf",
|
865
897
|
"ntptime",
|
866
898
|
"onewire",
|
867
899
|
"openamp",
|
868
900
|
"os",
|
869
901
|
"pcf85063a",
|
902
|
+
"pic16bit",
|
870
903
|
"picoexplorer",
|
871
904
|
"picographics",
|
872
905
|
"picokeypad",
|
@@ -878,12 +911,16 @@ def main():
|
|
878
911
|
"pimoroni_i2c",
|
879
912
|
"plasma",
|
880
913
|
"platform",
|
914
|
+
"powerpc",
|
881
915
|
"pyb",
|
882
916
|
"pycom",
|
883
917
|
"pye",
|
918
|
+
"qemu",
|
884
919
|
"qrcode",
|
885
920
|
"queue",
|
886
921
|
"random",
|
922
|
+
"renesas",
|
923
|
+
"renesas-ra",
|
887
924
|
"requests",
|
888
925
|
"requests/__init__",
|
889
926
|
"rp2",
|
@@ -896,6 +933,7 @@ def main():
|
|
896
933
|
"ssh",
|
897
934
|
"ssl",
|
898
935
|
"stm",
|
936
|
+
"stm32",
|
899
937
|
"struct",
|
900
938
|
"sys",
|
901
939
|
"termios",
|
@@ -936,6 +974,7 @@ def main():
|
|
936
974
|
"umqtt/__init__",
|
937
975
|
"umqtt/robust",
|
938
976
|
"umqtt/simple",
|
977
|
+
"unix",
|
939
978
|
"uos",
|
940
979
|
"uplatform",
|
941
980
|
"uqueue",
|
@@ -961,8 +1000,10 @@ def main():
|
|
961
1000
|
"uzlib",
|
962
1001
|
"version",
|
963
1002
|
"vfs",
|
1003
|
+
"webassembly",
|
964
1004
|
"websocket",
|
965
1005
|
"websocket_helper",
|
1006
|
+
"windows",
|
966
1007
|
"wipy",
|
967
1008
|
"writer",
|
968
1009
|
"xpt2046",
|
@@ -978,6 +1019,7 @@ def main():
|
|
978
1019
|
|
979
1020
|
if __name__ == "__main__" or is_micropython():
|
980
1021
|
if not file_exists("no_auto_stubber.txt"):
|
1022
|
+
print(f"createstubs.py: {__version__}")
|
981
1023
|
try:
|
982
1024
|
gc.threshold(4 * 1024) # type: ignore
|
983
1025
|
gc.enable()
|
stubber/board/createstubs_db.py
CHANGED
@@ -18,7 +18,7 @@ Create stubs for (all) modules on a MicroPython board.
|
|
18
18
|
- cross compilation, using mpy-cross, to avoid the compilation step on the micropython device
|
19
19
|
|
20
20
|
|
21
|
-
This variant was generated from createstubs.py by micropython-stubber v1.
|
21
|
+
This variant was generated from createstubs.py by micropython-stubber v1.24.0
|
22
22
|
"""
|
23
23
|
|
24
24
|
# Copyright (c) 2019-2024 Jos Verlinde
|
@@ -43,7 +43,7 @@ try:
|
|
43
43
|
except ImportError:
|
44
44
|
from ucollections import OrderedDict # type: ignore
|
45
45
|
|
46
|
-
__version__ = "v1.
|
46
|
+
__version__ = "v1.24.0"
|
47
47
|
ENOENT = 2
|
48
48
|
_MAX_CLASS_LEVEL = 2 # Max class nesting
|
49
49
|
LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
|
@@ -51,7 +51,7 @@ LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
|
|
51
51
|
|
52
52
|
# our own logging module to avoid dependency on and interfering with logging module
|
53
53
|
class logging:
|
54
|
-
|
54
|
+
DEBUG = 10
|
55
55
|
INFO = 20
|
56
56
|
WARNING = 30
|
57
57
|
ERROR = 40
|
@@ -66,9 +66,9 @@ class logging:
|
|
66
66
|
def basicConfig(cls, level):
|
67
67
|
cls.level = level
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
def debug(self, msg):
|
70
|
+
if self.level <= logging.DEBUG:
|
71
|
+
self.prnt("DEBUG :", msg)
|
72
72
|
|
73
73
|
def info(self, msg):
|
74
74
|
if self.level <= logging.INFO:
|
@@ -244,6 +244,7 @@ class Stubber:
|
|
244
244
|
return False
|
245
245
|
|
246
246
|
# Start a new file
|
247
|
+
# log.debug("Create file: {}".format(file_name))
|
247
248
|
ensure_folder(file_name)
|
248
249
|
with open(file_name, "w") as fp:
|
249
250
|
info_ = str(self.info).replace("OrderedDict(", "").replace("})", "}")
|
@@ -357,8 +358,10 @@ class Stubber:
|
|
357
358
|
|
358
359
|
if t in ("str", "int", "float", "bool", "bytearray", "bytes"):
|
359
360
|
# known type: use actual value
|
360
|
-
|
361
|
-
|
361
|
+
if item_name.upper() == item_name: # ALL_CAPS --> Final
|
362
|
+
s = "{0}{1}: Final[{3}] = {2}\n".format(indent, item_name, item_repr, t)
|
363
|
+
else:
|
364
|
+
s = "{0}{1}: {3} = {2}\n".format(indent, item_name, item_repr, t)
|
362
365
|
elif t in ("dict", "list", "tuple"):
|
363
366
|
# dict, list , tuple: use empty value
|
364
367
|
ev = {"dict": "{}", "list": "[]", "tuple": "()"}
|
@@ -491,6 +494,7 @@ def ensure_folder(path: str):
|
|
491
494
|
# folder does not exist
|
492
495
|
if e.args[0] == ENOENT:
|
493
496
|
try:
|
497
|
+
log.debug("Create folder {}".format(p))
|
494
498
|
os.mkdir(p)
|
495
499
|
except OSError as e2:
|
496
500
|
log.error("failed to create folder {}".format(p))
|
@@ -501,7 +505,7 @@ def ensure_folder(path: str):
|
|
501
505
|
|
502
506
|
def _build(s):
|
503
507
|
# extract build from sys.version or os.uname().version if available
|
504
|
-
# sys.version: 'MicroPython v1.
|
508
|
+
# sys.version: 'MicroPython v1.24.0-preview.6.g3d0b6276f'
|
505
509
|
# sys.implementation.version: 'v1.13-103-gb137d064e'
|
506
510
|
if not s:
|
507
511
|
return ""
|
@@ -606,29 +610,33 @@ def _info(): # type:() -> dict[str, str]
|
|
606
610
|
if (
|
607
611
|
info["version"]
|
608
612
|
and info["version"].endswith(".0")
|
609
|
-
and info["version"] >= "1.10.0" # versions from 1.10.0 to 1.
|
613
|
+
and info["version"] >= "1.10.0" # versions from 1.10.0 to 1.24.0 do not have a micro .0
|
610
614
|
and info["version"] <= "1.19.9"
|
611
615
|
):
|
612
|
-
# versions from 1.10.0 to 1.
|
616
|
+
# versions from 1.10.0 to 1.24.0 do not have a micro .0
|
613
617
|
info["version"] = info["version"][:-2]
|
614
618
|
|
615
619
|
# spell-checker: disable
|
616
620
|
if "mpy" in info and info["mpy"]: # mpy on some v1.11+ builds
|
617
621
|
sys_mpy = int(info["mpy"])
|
618
622
|
# .mpy architecture
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
623
|
+
try:
|
624
|
+
arch = [
|
625
|
+
None,
|
626
|
+
"x86",
|
627
|
+
"x64",
|
628
|
+
"armv6",
|
629
|
+
"armv6m",
|
630
|
+
"armv7m",
|
631
|
+
"armv7em",
|
632
|
+
"armv7emsp",
|
633
|
+
"armv7emdp",
|
634
|
+
"xtensa",
|
635
|
+
"xtensawin",
|
636
|
+
"rv32imc",
|
637
|
+
][sys_mpy >> 10]
|
638
|
+
except IndexError:
|
639
|
+
arch = "unknown"
|
632
640
|
if arch:
|
633
641
|
info["arch"] = arch
|
634
642
|
# .mpy version.minor
|
@@ -668,7 +676,7 @@ def get_root() -> str: # sourcery skip: use-assigned-variable
|
|
668
676
|
# unix port
|
669
677
|
c = "."
|
670
678
|
r = c
|
671
|
-
for r in [
|
679
|
+
for r in ["/remote", "/sd", "/flash", "/", c, "."]:
|
672
680
|
try:
|
673
681
|
_ = os.stat(r)
|
674
682
|
break
|
@@ -817,6 +825,7 @@ def main():
|
|
817
825
|
|
818
826
|
if __name__ == "__main__" or is_micropython():
|
819
827
|
if not file_exists("no_auto_stubber.txt"):
|
828
|
+
print(f"createstubs.py: {__version__}")
|
820
829
|
try:
|
821
830
|
gc.threshold(4 * 1024) # type: ignore
|
822
831
|
gc.enable()
|