micropython-stubber 1.25.1rc5__tar.gz → 1.25.1rc6__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 (109) hide show
  1. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/PKG-INFO +2 -2
  2. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/pyproject.toml +2 -2
  3. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/lookup.py +6 -0
  4. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/reader.py +15 -6
  5. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/stubs_from_docs.py +28 -15
  6. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/LICENSE +0 -0
  7. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/readme.md +0 -0
  8. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/__init__.py +0 -0
  9. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/board_info.csv +0 -0
  10. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/boot.py +0 -0
  11. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs.py +0 -0
  12. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_db.py +0 -0
  13. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_db_min.py +0 -0
  14. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  15. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_lvgl.py +0 -0
  16. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_lvgl_min.py +0 -0
  17. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_lvgl_mpy.mpy +0 -0
  18. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_mem.py +0 -0
  19. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_mem_min.py +0 -0
  20. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  21. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_min.py +0 -0
  22. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/createstubs_mpy.mpy +0 -0
  23. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/fw_info.py +0 -0
  24. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/info.py +0 -0
  25. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/main.py +0 -0
  26. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/modulelist.txt +0 -0
  27. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/pkg_full.json +0 -0
  28. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/pkg_minified.json +0 -0
  29. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/pkg_mpy.json +0 -0
  30. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/board/pyrightconfig.json +0 -0
  31. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/bulk/mcu_stubber.py +0 -0
  32. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/__init__.py +0 -0
  33. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/_partials/__init__.py +0 -0
  34. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/_partials/db_main.py +0 -0
  35. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/_partials/lvgl_main.py +0 -0
  36. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/_partials/modules_reader.py +0 -0
  37. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/add_comment.py +0 -0
  38. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/add_method.py +0 -0
  39. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/board.py +0 -0
  40. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/enrich.py +0 -0
  41. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/merge_docstub.py +0 -0
  42. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/modify_list.py +0 -0
  43. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/utils.py +0 -0
  44. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/codemod/visitors/type_helpers.py +0 -0
  45. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/__init__.py +0 -0
  46. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/build_cmd.py +0 -0
  47. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/cli.py +0 -0
  48. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/clone_cmd.py +0 -0
  49. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/config_cmd.py +0 -0
  50. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/enrich_folder_cmd.py +0 -0
  51. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/get_core_cmd.py +0 -0
  52. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/get_docstubs_cmd.py +0 -0
  53. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/get_frozen_cmd.py +0 -0
  54. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/get_mcu_cmd.py +0 -0
  55. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/merge_cmd.py +0 -0
  56. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/publish_cmd.py +0 -0
  57. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/stub_cmd.py +0 -0
  58. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/switch_cmd.py +0 -0
  59. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/commands/variants_cmd.py +0 -0
  60. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/data/board_info.csv +0 -0
  61. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/data/board_info.json +0 -0
  62. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/data/micropython_tags.csv +0 -0
  63. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/data/requirements-core-micropython.txt +0 -0
  64. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/data/requirements-core-pycopy.txt +0 -0
  65. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/downloader.py +0 -0
  66. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/freeze/__init__.py +0 -0
  67. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/freeze/common.py +0 -0
  68. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/freeze/freeze_folder.py +0 -0
  69. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/freeze/freeze_manifest_2.py +0 -0
  70. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/freeze/get_frozen.py +0 -0
  71. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/get_cpython.py +0 -0
  72. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/get_lobo.py +0 -0
  73. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/merge_config.py +0 -0
  74. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/minify.py +0 -0
  75. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/modcat.py +0 -0
  76. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/__init__.py +0 -0
  77. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/bump.py +0 -0
  78. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/candidates.py +0 -0
  79. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/database.py +0 -0
  80. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/defaults.py +0 -0
  81. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/enums.py +0 -0
  82. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/helpers.py +0 -0
  83. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/merge_docstubs.py +0 -0
  84. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/package.py +0 -0
  85. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/pathnames.py +0 -0
  86. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/publish.py +0 -0
  87. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/pypi.py +0 -0
  88. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/publish/stubpackage.py +0 -0
  89. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/__init__.py +0 -0
  90. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/classsort.py +0 -0
  91. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/output_dict.py +0 -0
  92. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/report_return.py +0 -0
  93. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/rst/rst_utils.py +0 -0
  94. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/stubber.py +0 -0
  95. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/tools/__init__.py +0 -0
  96. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/tools/manifestfile.py +0 -0
  97. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/tools/readme.md +0 -0
  98. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/typing_collector.py +0 -0
  99. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/update_fallback.py +0 -0
  100. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/update_module_list.py +0 -0
  101. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/__init__.py +0 -0
  102. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/config.py +0 -0
  103. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/makeversionhdr.py +0 -0
  104. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/manifest.py +0 -0
  105. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/post.py +0 -0
  106. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/repos.py +0 -0
  107. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/stubmaker.py +0 -0
  108. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/utils/typed_config_toml.py +0 -0
  109. {micropython_stubber-1.25.1rc5 → micropython_stubber-1.25.1rc6}/src/stubber/variants.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: micropython-stubber
3
- Version: 1.25.1rc5
3
+ Version: 1.25.1rc6
4
4
  Summary: Tooling to create and maintain stubs for MicroPython
5
5
  License: MIT
6
6
  Keywords: MicroPython,stubs,vscode,pyright,linting,static type check
@@ -25,7 +25,7 @@ Requires-Dist: executing (>=2.0.1,<3.0.0)
25
25
  Requires-Dist: importlib-metadata (>=1,<9) ; python_version < "3.8"
26
26
  Requires-Dist: libcst (>=1.1.0,<2.0.0)
27
27
  Requires-Dist: loguru (>=0.6,<0.8)
28
- Requires-Dist: mpflash (>=1.25.0.rc2)
28
+ Requires-Dist: mpflash (==1.25.0.rc3)
29
29
  Requires-Dist: mpremote (>=1.25.0)
30
30
  Requires-Dist: mpy-cross (>=1.25.0.post2,<2.0.0)
31
31
  Requires-Dist: mypy (>=1.10)
@@ -8,7 +8,7 @@ repo-path = "./repos"
8
8
 
9
9
  [tool.poetry]
10
10
  name = "micropython-stubber"
11
- version = "1.25.1.rc5"
11
+ version = "1.25.1.rc6"
12
12
  description = "Tooling to create and maintain stubs for MicroPython"
13
13
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
14
14
  license = "MIT"
@@ -50,7 +50,7 @@ mpremote = "mpremote.main:main"
50
50
  python = ">=3.9.2,<4.0"
51
51
  python-minifier = { version = "^2.7.0", python = "<3.14" }
52
52
  requests = "^2.32.3"
53
- mpflash = ">=1.25.0.rc2"
53
+ mpflash = "==1.25.0.rc3"
54
54
  mpremote = ">=1.25.0"
55
55
  # others
56
56
  autoflake = ">=1.7,<3.0"
@@ -445,6 +445,12 @@ PARAM_FIXES = [
445
445
  "(ip, subnet, gateway, dns):Optional[Any]=None",
446
446
  "configtuple: Optional[Tuple]",
447
447
  ),
448
+ # network.ipconfig
449
+ Fix(
450
+ "param=value",
451
+ "param:Optional[str]=None",
452
+ name="ipconfig",
453
+ ),
448
454
  # framebuffer
449
455
  # unresolvable parameter defaults # FrameBuffer: def __init__
450
456
  Fix(
@@ -69,10 +69,19 @@ from typing import List, Optional, Tuple
69
69
 
70
70
  from mpflash.logger import log
71
71
  from mpflash.versions import V_PREVIEW
72
- from stubber.rst import (CHILD_PARENT_CLASS, MODULE_GLUE, PARAM_FIXES,
73
- PARAM_RE_FIXES, RST_DOC_FIXES, TYPING_IMPORT,
74
- ClassSourceDict, FunctionSourceDict, ModuleSourceDict,
75
- return_type_from_context)
72
+
73
+ from stubber.rst import (
74
+ CHILD_PARENT_CLASS,
75
+ MODULE_GLUE,
76
+ PARAM_FIXES,
77
+ PARAM_RE_FIXES,
78
+ RST_DOC_FIXES,
79
+ TYPING_IMPORT,
80
+ ClassSourceDict,
81
+ FunctionSourceDict,
82
+ ModuleSourceDict,
83
+ return_type_from_context,
84
+ )
76
85
  from stubber.rst.lookup import Fix
77
86
  from stubber.utils.config import CONFIG
78
87
 
@@ -496,8 +505,8 @@ class RSTParser(RSTReader):
496
505
  self.read_file(file_path)
497
506
  self.parse()
498
507
  # reset this file to done
499
- self.rst_text = []
500
- self.line_no = 1
508
+ # self.rst_text = []
509
+ # self.line_no = 1
501
510
 
502
511
  def parse_module(self):
503
512
  "parse a module tag and set the module's docstring"
@@ -78,23 +78,11 @@ def get_rst_sources(rst_path: Path, pattern: str) -> List[Path]:
78
78
  def make_docstubs(
79
79
  dst_path: Path, v_tag: str, release: str, suffix: str, files: List[Path], clean_rst: bool
80
80
  ):
81
- """Create the docstubs"""
81
+ """Create docstubs from the list of rst files"""
82
82
 
83
83
  for file in files:
84
- reader = RSTWriter(v_tag)
85
- reader.clean_rst = clean_rst
86
- reader.source_release = release
87
- log.debug(f"Reading: {file}")
88
- reader.read_file(file)
89
- reader.parse()
90
- # Destination = "module.__init__.pyi"
91
- if "." in file.stem:
92
- target = dst_path / f"{(file.stem).replace('.', '/')}{suffix}"
93
- else:
94
- target = dst_path / file.stem / f"__init__{suffix}"
95
- # fname = (dst_path / file.name).with_suffix(suffix)
96
- reader.write_file(target)
97
- del reader
84
+ make_docstub(file, dst_path, v_tag, release, suffix, clean_rst)
85
+
98
86
  for name in U_MODULES:
99
87
  # create a file "umodule.pyi" for each module
100
88
  # and add a line : from module import *
@@ -107,3 +95,28 @@ def make_docstubs(
107
95
  f.write("# Allow the use of micro-module notation \n\n")
108
96
  f.write(f"from {name} import * # type: ignore\n")
109
97
  f.flush()
98
+
99
+
100
+ def make_docstub(
101
+ file: Path,
102
+ dst_path: Path,
103
+ v_tag: str,
104
+ release: str,
105
+ suffix: str,
106
+ clean_rst: bool,
107
+ ):
108
+ """Create a docstub from a single rst file"""
109
+ reader = RSTWriter(v_tag)
110
+ reader.clean_rst = clean_rst
111
+ reader.source_release = release
112
+ log.debug(f"Reading: {file}")
113
+ reader.read_file(file)
114
+ reader.parse()
115
+
116
+ if "." in file.stem:
117
+ target = dst_path / f"{(file.stem).replace('.', '/')}{suffix}"
118
+ else:
119
+ target = dst_path / file.stem / f"__init__{suffix}"
120
+
121
+ reader.write_file(target)
122
+ del reader