micropython-stubber 1.17.6__tar.gz → 1.19.0__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 (162) hide show
  1. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/PKG-INFO +7 -6
  2. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/pyproject.toml +61 -46
  3. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/readme.md +4 -4
  4. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/README.md +18 -2
  5. micropython_stubber-1.19.0/src/mpflash/libusb_flash.ipynb +203 -0
  6. micropython_stubber-1.19.0/src/mpflash/mpflash/ask_input.py +234 -0
  7. micropython_stubber-1.19.0/src/mpflash/mpflash/cli_download.py +107 -0
  8. micropython_stubber-1.19.0/src/mpflash/mpflash/cli_flash.py +165 -0
  9. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/cli_group.py +39 -6
  10. micropython_stubber-1.19.0/src/mpflash/mpflash/cli_list.py +41 -0
  11. micropython_stubber-1.19.0/src/mpflash/mpflash/cli_main.py +26 -0
  12. micropython_stubber-1.19.0/src/mpflash/mpflash/common.py +38 -0
  13. micropython_stubber-1.19.0/src/mpflash/mpflash/config.py +19 -0
  14. micropython_stubber-1.17.6/src/mpflash/mpflash/downloader.py → micropython_stubber-1.19.0/src/mpflash/mpflash/download.py +110 -96
  15. micropython_stubber-1.19.0/src/mpflash/mpflash/downloaded.py +108 -0
  16. micropython_stubber-1.19.0/src/mpflash/mpflash/errors.py +5 -0
  17. micropython_stubber-1.19.0/src/mpflash/mpflash/flash.py +69 -0
  18. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/flash_esp.py +17 -23
  19. micropython_stubber-1.19.0/src/mpflash/mpflash/flash_stm32.py +24 -0
  20. micropython_stubber-1.19.0/src/mpflash/mpflash/flash_stm32_cube.py +111 -0
  21. micropython_stubber-1.19.0/src/mpflash/mpflash/flash_stm32_dfu.py +101 -0
  22. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/flash_uf2.py +8 -8
  23. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/flash_uf2_linux.py +13 -6
  24. micropython_stubber-1.19.0/src/mpflash/mpflash/flash_uf2_windows.py +34 -0
  25. micropython_stubber-1.19.0/src/mpflash/mpflash/list.py +72 -0
  26. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/logger.py +12 -13
  27. micropython_stubber-1.19.0/src/mpflash/mpflash/mpboard_id/__init__.py +96 -0
  28. micropython_stubber-1.19.0/src/mpflash/mpflash/mpboard_id/board_id.py +63 -0
  29. micropython_stubber-1.19.0/src/mpflash/mpflash/mpboard_id/board_info.csv +2213 -0
  30. micropython_stubber-1.19.0/src/mpflash/mpflash/mpboard_id/board_info.json +19910 -0
  31. micropython_stubber-1.19.0/src/mpflash/mpflash/mpremoteboard/__init__.py +208 -0
  32. {micropython_stubber-1.17.6/src/stubber/bulk → micropython_stubber-1.19.0/src/mpflash/mpflash/mpremoteboard}/runner.py +19 -4
  33. micropython_stubber-1.19.0/src/mpflash/mpflash/vendor/dfu.py +164 -0
  34. micropython_stubber-1.19.0/src/mpflash/mpflash/vendor/pydfu.py +605 -0
  35. micropython_stubber-1.19.0/src/mpflash/mpflash/vendor/readme.md +3 -0
  36. micropython_stubber-1.17.6/src/mpflash/mpflash/common.py → micropython_stubber-1.19.0/src/mpflash/mpflash/vendor/versions.py +21 -34
  37. micropython_stubber-1.19.0/src/mpflash/mpflash/worklist.py +147 -0
  38. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/poetry.lock +411 -595
  39. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/pyproject.toml +22 -6
  40. micropython_stubber-1.19.0/src/mpflash/stm32_udev_rules.md +63 -0
  41. micropython_stubber-1.19.0/src/stubber/__init__.py +3 -0
  42. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/basicgit.py +1 -0
  43. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs.py +10 -4
  44. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_db.py +11 -5
  45. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_db_min.py +61 -58
  46. micropython_stubber-1.19.0/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  47. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_mem.py +11 -5
  48. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_mem_min.py +56 -53
  49. micropython_stubber-1.19.0/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  50. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_min.py +54 -51
  51. micropython_stubber-1.19.0/src/stubber/board/createstubs_mpy.mpy +0 -0
  52. micropython_stubber-1.19.0/src/stubber/board/fw_info.py +141 -0
  53. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/bulk/mcu_stubber.py +9 -5
  54. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/_partials/db_main.py +14 -25
  55. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/_partials/lvgl_main.py +2 -2
  56. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/board.py +10 -3
  57. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/clone_cmd.py +7 -7
  58. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/config_cmd.py +3 -0
  59. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/freeze/get_frozen.py +0 -2
  60. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/candidates.py +1 -1
  61. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/package.py +1 -1
  62. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/pathnames.py +1 -1
  63. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/stubpackage.py +1 -0
  64. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/lookup.py +1 -1
  65. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/tools/manifestfile.py +5 -3
  66. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/config.py +26 -36
  67. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/repos.py +2 -2
  68. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/versions.py +1 -0
  69. micropython_stubber-1.17.6/src/mpflash/mpflash/cli_main.py +0 -21
  70. micropython_stubber-1.17.6/src/mpflash/mpflash/config.py +0 -10
  71. micropython_stubber-1.17.6/src/mpflash/mpflash/flash_stm32.py +0 -121
  72. micropython_stubber-1.17.6/src/mpflash/mpflash/flash_uf2_windows.py +0 -22
  73. micropython_stubber-1.17.6/src/mpflash/mpflash/flasher.py +0 -276
  74. micropython_stubber-1.17.6/src/mpflash/mpflash/list.py +0 -71
  75. micropython_stubber-1.17.6/src/stubber/__init__.py +0 -3
  76. micropython_stubber-1.17.6/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  77. micropython_stubber-1.17.6/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  78. micropython_stubber-1.17.6/src/stubber/board/createstubs_mpy.mpy +0 -0
  79. micropython_stubber-1.17.6/src/stubber/bulk/board_id.py +0 -40
  80. micropython_stubber-1.17.6/src/stubber/bulk/mpremoteboard.py +0 -141
  81. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/LICENSE +0 -0
  82. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/mpflash/mpflash/__init__.py +0 -0
  83. /micropython_stubber-1.17.6/src/mpflash/mpflash/uf2_boardid.py → /micropython_stubber-1.19.0/src/mpflash/mpflash/flash_uf2_boardid.py +0 -0
  84. /micropython_stubber-1.17.6/src/stubber/board/fw_info.py → /micropython_stubber-1.19.0/src/mpflash/mpflash/mpremoteboard/mpy_fw_info.py +0 -0
  85. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/board_info.csv +0 -0
  86. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/boot.py +0 -0
  87. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_lvgl.py +0 -0
  88. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_lvgl_min.py +0 -0
  89. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/createstubs_lvgl_mpy.mpy +0 -0
  90. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/info.py +0 -0
  91. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/main.py +0 -0
  92. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/modulelist.txt +0 -0
  93. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/board/pyrightconfig.json +0 -0
  94. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/__init__.py +0 -0
  95. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/_partials/__init__.py +0 -0
  96. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/_partials/modules_reader.py +0 -0
  97. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/add_comment.py +0 -0
  98. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/add_method.py +0 -0
  99. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/enrich.py +0 -0
  100. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/merge_docstub.py +0 -0
  101. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/modify_list.py +0 -0
  102. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/codemod/utils.py +0 -0
  103. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/__init__.py +0 -0
  104. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/build_cmd.py +0 -0
  105. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/cli.py +0 -0
  106. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/enrich_folder_cmd.py +0 -0
  107. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/get_core_cmd.py +0 -0
  108. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/get_docstubs_cmd.py +0 -0
  109. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/get_frozen_cmd.py +0 -0
  110. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/get_lobo_cmd.py +0 -0
  111. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/mcu_cmd.py +0 -0
  112. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/merge_cmd.py +0 -0
  113. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/minify_cmd.py +0 -0
  114. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/publish_cmd.py +0 -0
  115. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/stub_cmd.py +0 -0
  116. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/switch_cmd.py +0 -0
  117. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/upd_fallback_cmd.py +0 -0
  118. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/upd_module_list_cmd.py +0 -0
  119. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/commands/variants_cmd.py +0 -0
  120. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/cst_transformer.py +0 -0
  121. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/data/board_info.csv +0 -0
  122. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/data/board_info.json +0 -0
  123. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/data/micropython_tags.csv +0 -0
  124. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/data/requirements-core-micropython.txt +0 -0
  125. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/data/requirements-core-pycopy.txt +0 -0
  126. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/downloader.py +0 -0
  127. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/freeze/__init__.py +0 -0
  128. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/freeze/common.py +0 -0
  129. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/freeze/freeze_folder.py +0 -0
  130. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/freeze/freeze_manifest_2.py +0 -0
  131. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/get_cpython.py +0 -0
  132. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/get_lobo.py +0 -0
  133. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/minify.py +0 -0
  134. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/__init__.py +0 -0
  135. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/bump.py +0 -0
  136. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/database.py +0 -0
  137. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/defaults.py +0 -0
  138. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/enums.py +0 -0
  139. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/helpers.py +0 -0
  140. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/merge_docstubs.py +0 -0
  141. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/missing_class_methods.py +0 -0
  142. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/publish.py +0 -0
  143. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/publish/pypi.py +0 -0
  144. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/__init__.py +0 -0
  145. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/classsort.py +0 -0
  146. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/output_dict.py +0 -0
  147. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/reader.py +0 -0
  148. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/report_return.py +0 -0
  149. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/rst/rst_utils.py +0 -0
  150. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/stubber.py +0 -0
  151. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/stubs_from_docs.py +0 -0
  152. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/tools/__init__.py +0 -0
  153. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/tools/readme.md +0 -0
  154. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/update_fallback.py +0 -0
  155. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/update_module_list.py +0 -0
  156. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/__init__.py +0 -0
  157. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/makeversionhdr.py +0 -0
  158. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/manifest.py +0 -0
  159. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/post.py +0 -0
  160. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/stubmaker.py +0 -0
  161. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/utils/typed_config_toml.py +0 -0
  162. {micropython_stubber-1.17.6 → micropython_stubber-1.19.0}/src/stubber/variants.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micropython-stubber
3
- Version: 1.17.6
3
+ Version: 1.19.0
4
4
  Summary: Tooling to create and maintain stubs for MicroPython
5
5
  Home-page: https://github.com/Josverl/micropython-stubber#readme
6
6
  License: MIT
7
7
  Keywords: MicroPython,stubs,vscode,pyright,linting,static type check
8
8
  Author: Jos Verlinde
9
9
  Author-email: jos_verlinde@hotmail.com
10
- Requires-Python: >=3.9,<3.12
10
+ Requires-Python: >=3.9,<4.0
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.9
@@ -25,6 +25,7 @@ Requires-Dist: executing (>=2.0.1,<3.0.0)
25
25
  Requires-Dist: importlib-metadata (>=1.0,<2.0) ; 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 (>=0.6.0)
28
29
  Requires-Dist: mpremote (>=1.22.0,<2.0.0)
29
30
  Requires-Dist: mypy (==1.7.0)
30
31
  Requires-Dist: mypy-gitlab-code-quality (>=1.1.0,<2.0.0)
@@ -51,13 +52,13 @@ Description-Content-Type: text/markdown
51
52
 
52
53
  [![pypi version](https://badgen.net/pypi/v/micropython-stubber)](https://pypi.org/project/micropython-stubber/)
53
54
  [![python versions](https://badgen.net/pypi/python/micropython-stubber)](https://badgen.net/pypi/python/micropython-stubber)
54
- [![Documentation Status](https://readthedocs.org/projects/micropython-stubber/badge/?version=latest)](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")
55
+ [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")
55
56
  [![Star on GitHub](https://img.shields.io/github/stars/josverl/micropython-stubber.svg?style=social)](https://github.com/josverl/micropython-stubber/stargazers)
56
57
  [![All Contributors](https://img.shields.io/badge/all_contributors-19-green.svg?style=flat-square)](#Contributions)
57
58
  <!-- break -->
58
- [![pytest tests/common](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml)
59
- [![codecov](https://codecov.io/gh/Josverl/micropython-stubber/branch/main/graph/badge.svg?token=WJFGMKBHOV)](https://codecov.io/gh/Josverl/micropython-stubber)
60
- [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")
59
+ [![pytest stubber](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml)
60
+ [![pytest mpflash](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest_mpflash.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest_mpflash.yml)
61
+ [![Documentation Status](https://readthedocs.org/projects/micropython-stubber/badge/?version=latest)](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")
61
62
  <!-- break -->
62
63
  [![Open in VSCode](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc
63
64
  )](https://open.vscode.dev/josverl/micropython-stubber)
@@ -8,7 +8,7 @@ repo-path = "./repos"
8
8
 
9
9
  [tool.poetry]
10
10
  name = "micropython-stubber"
11
- version = "1.17.6"
11
+ version = "1.19.0"
12
12
  description = "Tooling to create and maintain stubs for MicroPython"
13
13
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
14
14
  license = "MIT"
@@ -45,33 +45,35 @@ exclude = [
45
45
  stubber = "stubber.stubber:stubber_cli"
46
46
 
47
47
  [tool.poetry.dependencies]
48
- python = ">=3.9,<3.12"
49
- python-minifier = { version = "^2.7.0", python = "<3.12" } # no support for 3.12 yet
50
- requests = "^2.28.0"
51
- mypy = "1.7.0"
52
- black = ">=22.10,<23.0"
53
- libcst = "^1.1.0"
48
+ python = ">=3.9,<4.0"
49
+ mpflash = ">=0.6.0"
50
+ mpremote = "^1.22.0"
51
+ # others
54
52
  autoflake = ">=1.7,<3.0"
53
+ black = ">=22.10,<23.0"
55
54
  cachetools = "^5.3.0"
56
55
  click = "^8.1.3"
56
+ executing = "^2.0.1"
57
57
  importlib-metadata = { version = "^1.0", python = "<3.8" }
58
+ libcst = "^1.1.0"
58
59
  loguru = ">=0.6,<0.8"
60
+ mypy = "1.7.0"
61
+ mypy-gitlab-code-quality = "^1.1.0"
59
62
  packaging = ">=21.3,<24.0"
60
63
  pipx = "^1.1.0"
61
64
  pygithub = "^2.1.1"
62
- pypi-simple = "^1.0.0"
63
65
  pyright = "^1.1.341"
66
+ pyserial = "^3.5"
64
67
  pysondb-v2 = "^2.1.0"
68
+ pypi-simple = "^1.0.0"
69
+ python-minifier = { version = "^2.7.0", python = "<3.12" } # no support for 3.12 yet
70
+ requests = "^2.28.0"
71
+ rich-click = "^1.7.3"
65
72
  tabulate = "^0.9.0"
66
73
  tenacity = "^8.2.2"
67
74
  tomli = { version = "^2.0.1", python = "<3.11" }
68
75
  tomli-w = "^1.0.0"
69
76
  typed-config = "^1.3.0"
70
- pyserial = "^3.5"
71
- executing = "^2.0.1"
72
- mypy-gitlab-code-quality = "^1.1.0"
73
- rich-click = "^1.7.3"
74
- mpremote = "^1.22.0"
75
77
 
76
78
  [tool.poetry.group.docs]
77
79
  optional = true
@@ -83,21 +85,24 @@ sphinx-autoapi = "^3.0.0"
83
85
  sphinx-click = "5.1.0"
84
86
  sphinxcontrib-mermaid = ">=0.9.2"
85
87
 
86
- [tool.poetry.group.dev]
88
+ [tool.poetry.group.test]
87
89
  optional = true
88
- [tool.poetry.group.dev.dependencies]
90
+ [tool.poetry.group.test.dependencies]
89
91
  coverage = ">=6.4.3,<8.0.0"
90
- distro = "^1.8.0"
91
- mock = "^4.0.3"
92
- pydeps = "^1.10.22"
93
92
  pytest = "^7.1.2"
94
93
  pytest-github-actions-annotate-failures = ">=0.1.7,<0.3.0"
95
94
  pytest-json-report = "^1.5.0"
96
95
  pytest-metadata = ">=2.0.2,<4.0.0"
97
96
  pytest-mock = "^3.10.0"
98
- # mpremote = { git = "https://github.com/Josverl/mpremote", subdirectory = "tools/mpremote", optional = true }
99
- ipykernel = "^6.23.1"
97
+ mock = "^4.0.3"
98
+ distro = "^1.8.0"
100
99
  fasteners = "^0.19"
100
+
101
+ [tool.poetry.group.dev]
102
+ optional = true
103
+ [tool.poetry.group.dev.dependencies]
104
+ pydeps = "^1.10.22"
105
+ ipykernel = "^6.23.1"
101
106
  python-dotenv = "^1.0.0"
102
107
  pydocstyle = "^6.3.0"
103
108
  chime = "^0.7.0"
@@ -186,7 +191,7 @@ reportUntypedNamedTuple = "none"
186
191
  [tool.black]
187
192
  # use long lines to avoid _log lines from wrapping , as this causes issues with the minification.
188
193
  line-length = 140
189
- target_version = ['py38']
194
+ # target_version = ['py38']
190
195
  include = '\.pyi?$'
191
196
  exclude = '''
192
197
  (
@@ -211,18 +216,19 @@ exclude = '''
211
216
  minversion = "7.0"
212
217
  python_functions = ["test_", "*_test"]
213
218
  python_files = ["test_*.py", "*_test.py"]
214
- testpaths = ["tests", "src", "repos/micropython-stubs/tests", "modules/**/tests"]
219
+ testpaths = [
220
+ "tests",
221
+ "src/stubber",
222
+ "src/mpflash",
223
+ "repos/micropython-stubs/tests",
224
+ "modules/**/tests",
225
+ ]
215
226
  norecursedirs = [
216
- "repos",
217
- "typings*",
218
- ".svn",
219
- "_build",
220
- "tmp*",
221
227
  ".*",
222
- "build",
223
- "dist",
224
- "{arch}",
225
- "*.egg",
228
+ ".*/*",
229
+ # "repos/*",
230
+ "tests/codemods/codemod_test_cases/*",
231
+ "typings*",
226
232
  ]
227
233
  junit_family = "xunit1"
228
234
 
@@ -233,56 +239,65 @@ addopts = "--verbose --capture=no -m 'not basicgit'"
233
239
  # -n --numprocesses=numprocesses -
234
240
 
235
241
  markers = [
242
+ "stubber: marks tests of the stubber tool",
243
+ "mpflash: marks tests of the mpflash tool",
244
+ "snippets: test snippets to check the stubs",
245
+
246
+ "legacy: reeally old tests that need to be updated or removed",
247
+
248
+ "version: run test only on specific MicroPython version",
249
+
236
250
  "slow: marks tests as slow (deselect with '-m \"not slow\"')",
237
251
  "integration: Integration tests (slower)",
238
252
  "basicgit: marks tests in the basicgit module that manipulate the checkout",
239
253
  "mocked: to replace/compensate for most of the slow and git tests",
240
- "snippets: test snippets to check the stubs",
241
254
  #
242
255
  "minified: marks test of the minified version of createstubs",
243
256
  "minify: marks test of the minification of createstubs",
257
+ "native: Createstubs run against a native micropython implementation",
244
258
  "docfix: upstream documentation fix needed",
245
259
  "micropython: tests of MicroPython code on Cpython with mocks",
246
260
  "doc_stubs: tests to generate stubs from the rst documentation",
247
261
  "codemod: test libcst code modification",
248
262
  "cli: test command line interface",
249
- # os versions
263
+ # os platforms
250
264
  "win32: run test only on Windows",
251
265
  "linux: run test only on linux",
252
266
  "darwin: run test only on Mac",
253
- "version: run test only on specific version",
254
- "1.19.0: run test only on 1.19.0",
255
- "1.20.0: run test only on 1.20.0",
267
+ # micropython version dependencies
268
+
269
+
256
270
  ]
257
271
 
258
272
  # coverage reports
273
+
259
274
  [tool.coverage.run]
260
275
  parallel = false
261
276
  branch = true
262
- source = ["src"]
277
+ source = [
278
+ "src/stubber",
279
+ "src/mpflash",
280
+ ]
263
281
  omit = [
264
282
  # helper files in board
265
283
  "*/boot.py",
266
284
  "*/main.py",
267
285
  "*/stub_lvgl.py",
268
286
 
269
- "*/__init__.py",
270
-
271
- # minfied files should be excluded
272
- # duplicate file names in different folders break the coverage reports
273
- # "*/minified/*.py",
274
-
275
287
  # dev helper script in src
276
288
  "*/src/stubber/rst/report_return.py",
277
289
  "*/src/stubber/update_module_list.py",
278
290
 
279
291
  # not my code
280
- "*/logging.py",
281
- "*/make_stub_files.py",
282
- "*/stubber/tools/*.py",
292
+ "*/src/stubber/tools/*.py",
293
+ "*/src/mpflash/mpflash/vendored/*.py",
283
294
 
284
295
  # partial files for variant generation
285
296
  "*/codemod/_partials/*.py",
297
+
298
+ # pytest code
299
+ "*/test_*.py",
300
+ "*/*_test.py",
286
301
  ]
287
302
 
288
303
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  [![pypi version](https://badgen.net/pypi/v/micropython-stubber)](https://pypi.org/project/micropython-stubber/)
4
4
  [![python versions](https://badgen.net/pypi/python/micropython-stubber)](https://badgen.net/pypi/python/micropython-stubber)
5
- [![Documentation Status](https://readthedocs.org/projects/micropython-stubber/badge/?version=latest)](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")
5
+ [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")
6
6
  [![Star on GitHub](https://img.shields.io/github/stars/josverl/micropython-stubber.svg?style=social)](https://github.com/josverl/micropython-stubber/stargazers)
7
7
  [![All Contributors](https://img.shields.io/badge/all_contributors-19-green.svg?style=flat-square)](#Contributions)
8
8
  <!-- break -->
9
- [![pytest tests/common](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml)
10
- [![codecov](https://codecov.io/gh/Josverl/micropython-stubber/branch/main/graph/badge.svg?token=WJFGMKBHOV)](https://codecov.io/gh/Josverl/micropython-stubber)
11
- [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")
9
+ [![pytest stubber](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml)
10
+ [![pytest mpflash](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest_mpflash.yml/badge.svg)](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest_mpflash.yml)
11
+ [![Documentation Status](https://readthedocs.org/projects/micropython-stubber/badge/?version=latest)](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")
12
12
  <!-- break -->
13
13
  [![Open in VSCode](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc
14
14
  )](https://open.vscode.dev/josverl/micropython-stubber)
@@ -9,12 +9,28 @@ mpflash has been tested on Windows x64, Linux X64 and ARM64, but not (yet) macOS
9
9
  1. List the connected boards including their firmware details, in a tabular or json format
10
10
  2. Download MicroPython firmware for specific boards and versions.
11
11
  3. Flash one or all connected MicroPython boards with a specific firmware or version.
12
- Tested ports: rp2, samd, esp32, esp32s3, esp8266 and stm32 (requires cubeprogrammer)
12
+ Tested ports: rp2, samd, esp32, esp32s3, esp8266 and stm32
13
13
 
14
14
  ## Installation
15
15
  To install mpflash, you can use pip: `pip install mpflash`
16
16
 
17
- ## How to use
17
+ ## Basic usage
18
+ You can use mpflash to perform various operations on your MicroPython boards. Here is an example of basic usage:
19
+
20
+ | Command | Description |
21
+ |---------|-------------|
22
+ | `mpflash list` | List the connected board(s) including their firmware details |
23
+ | `mpflash download` | Download the MicroPython firmware(s) for the connected board(s) |
24
+ | `mpflash flash` | Flash the latest stable firmware to the connected board(s) |
25
+
26
+
27
+ ## Linux permissions to access usb devices
28
+ In order to flash the firmware to the board, you need to have the correct permissions to access the USB devices.
29
+ On Windows this will not be an issue, but on Linux you can use udev rules to give non-root users access to the USB devices.
30
+ [See the stm32_permissions documentation](./stm32_udev_rules.md) for more information.
31
+
32
+
33
+ ## Advanced use
18
34
  You can list the connected boards using the following command:
19
35
  ```bash
20
36
  $ mpflash list
@@ -0,0 +1,203 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 3,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "data": {
10
+ "text/plain": [
11
+ "[<DEVICE ID 0a05:7211 on Bus 002 Address 054>,\n",
12
+ " <DEVICE ID 0a05:7211 on Bus 002 Address 032>,\n",
13
+ " <DEVICE ID 045e:0c1e on Bus 002 Address 002>,\n",
14
+ " <DEVICE ID 045e:07b2 on Bus 002 Address 028>,\n",
15
+ " <DEVICE ID 045e:0904 on Bus 002 Address 015>,\n",
16
+ " <DEVICE ID 043e:9a39 on Bus 002 Address 057>,\n",
17
+ " <DEVICE ID 045e:0901 on Bus 002 Address 006>,\n",
18
+ " <DEVICE ID 05e3:0610 on Bus 002 Address 010>,\n",
19
+ " <DEVICE ID 2109:0817 on Bus 001 Address 001>,\n",
20
+ " <DEVICE ID 045e:0902 on Bus 002 Address 008>,\n",
21
+ " <DEVICE ID 1000:2000 on Bus 002 Address 016>,\n",
22
+ " <DEVICE ID 1189:8890 on Bus 002 Address 027>,\n",
23
+ " <DEVICE ID 2109:0817 on Bus 001 Address 002>,\n",
24
+ " <DEVICE ID 2109:2812 on Bus 002 Address 025>,\n",
25
+ " <DEVICE ID 046d:085e on Bus 002 Address 017>,\n",
26
+ " <DEVICE ID 045e:07c6 on Bus 002 Address 056>,\n",
27
+ " <DEVICE ID 0bda:5401 on Bus 002 Address 009>,\n",
28
+ " <DEVICE ID 10c4:ea60 on Bus 002 Address 055>,\n",
29
+ " <DEVICE ID 2109:2817 on Bus 002 Address 004>,\n",
30
+ " <DEVICE ID 0bda:5411 on Bus 002 Address 005>,\n",
31
+ " <DEVICE ID 045e:0900 on Bus 002 Address 003>,\n",
32
+ " <DEVICE ID 04e8:61f5 on Bus 002 Address 023>,\n",
33
+ " <DEVICE ID 045e:0903 on Bus 002 Address 020>,\n",
34
+ " <DEVICE ID 2109:2812 on Bus 002 Address 026>,\n",
35
+ " <DEVICE ID 8086:a0ed on Bus 002 Address 000>,\n",
36
+ " <DEVICE ID 2109:2817 on Bus 002 Address 013>,\n",
37
+ " <DEVICE ID 8087:0029 on Bus 002 Address 001>,\n",
38
+ " <DEVICE ID 8086:9a13 on Bus 001 Address 000>]"
39
+ ]
40
+ },
41
+ "execution_count": 3,
42
+ "metadata": {},
43
+ "output_type": "execute_result"
44
+ }
45
+ ],
46
+ "source": [
47
+ "import usb.core\n",
48
+ "import usb.util\n",
49
+ "import usb.backend.libusb1 as libusb1\n",
50
+ "from usb.core import USBError, Device\n",
51
+ "\n",
52
+ "from pathlib import Path\n",
53
+ "import platform\n",
54
+ "\n",
55
+ "if platform.system() == \"Windows\":\n",
56
+ " # on windows you need to use the libusb1 backend\n",
57
+ " import libusb\n",
58
+ "\n",
59
+ " arch = \"x64\" if platform.architecture()[0] == \"64bit\" else \"x86\"\n",
60
+ " libusb1_dll = Path(libusb.__file__).parent / f\"_platform\\\\_windows\\\\{arch}\\\\libusb-1.0.dll\"\n",
61
+ "\n",
62
+ " backend = libusb1.get_backend(find_library=lambda x: libusb1_dll.as_posix())\n",
63
+ "usb_devices = usb.core.find(backend=backend, find_all=True)\n",
64
+ "\n",
65
+ "list(usb_devices)"
66
+ ]
67
+ },
68
+ {
69
+ "cell_type": "code",
70
+ "execution_count": null,
71
+ "metadata": {},
72
+ "outputs": [],
73
+ "source": [
74
+ "for d in usb.core.find(backend=backend, find_all=True):\n",
75
+ " print(f\"Device {d.idVendor:04x}:{d.idProduct:04x}\")\n",
76
+ " print(f\"{d.iManufacturer=}\")\n",
77
+ " print(f\"{d.iProduct=}\")\n",
78
+ " print(f\"{d.bDeviceClass=}\")\n",
79
+ " print(f\"{d.bDescriptorType=}\")\n",
80
+ " print(f\"{d.bcdDevice=}\")\n",
81
+ " print(f\"{d.bcdUSB=}\")\n",
82
+ " # print(dir(d))\n",
83
+ " # print(f\" Manufacturer: {usb.util.get_string(dev, dev.iManufacturer)}\")\n",
84
+ "\n",
85
+ " print()"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "code",
90
+ "execution_count": null,
91
+ "metadata": {},
92
+ "outputs": [],
93
+ "source": [
94
+ "import serial.tools.list_ports\n",
95
+ "\n",
96
+ "ports = serial.tools.list_ports.comports()\n",
97
+ "\n",
98
+ "for port in ports:\n",
99
+ " print(f\"Port: {port.device}\")\n",
100
+ " print(f\"Description: {port.description}\")\n",
101
+ " print(f\"Hardware ID: {port.hwid}\")\n",
102
+ " print()"
103
+ ]
104
+ },
105
+ {
106
+ "cell_type": "code",
107
+ "execution_count": null,
108
+ "metadata": {},
109
+ "outputs": [],
110
+ "source": [
111
+ "from mpflash.vendor import pydfu as pydfu\n",
112
+ "\n",
113
+ "try:\n",
114
+ " pydfu.list_dfu_devices()\n",
115
+ "except SystemExit:\n",
116
+ " print(\"No DFU devices found\")"
117
+ ]
118
+ },
119
+ {
120
+ "cell_type": "code",
121
+ "execution_count": null,
122
+ "metadata": {},
123
+ "outputs": [],
124
+ "source": [
125
+ "pydfu.init()"
126
+ ]
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "execution_count": null,
131
+ "metadata": {},
132
+ "outputs": [],
133
+ "source": [
134
+ "dfu_file = Path(\"C:\\\\Users\\\\josverl\\\\Downloads\\\\firmware\\\\stm32\\\\PYBV11-THREAD-v1.23.0-preview.203.dfu\")\n",
135
+ "\n",
136
+ "print(\"Read DFU file...\")\n",
137
+ "elements = pydfu.read_dfu_file(dfu_file)\n",
138
+ "if not elements:\n",
139
+ " print(\"No data in dfu file\")"
140
+ ]
141
+ },
142
+ {
143
+ "cell_type": "code",
144
+ "execution_count": 1,
145
+ "metadata": {},
146
+ "outputs": [
147
+ {
148
+ "name": "stdout",
149
+ "output_type": "stream",
150
+ "text": [
151
+ "Writing memory...\n"
152
+ ]
153
+ },
154
+ {
155
+ "ename": "NameError",
156
+ "evalue": "name 'pydfu' is not defined",
157
+ "output_type": "error",
158
+ "traceback": [
159
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
160
+ "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
161
+ "Cell \u001b[1;32mIn[1], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWriting memory...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m----> 2\u001b[0m \u001b[43mpydfu\u001b[49m\u001b[38;5;241m.\u001b[39mwrite_elements(elements, \u001b[38;5;28;01mFalse\u001b[39;00m, progress\u001b[38;5;241m=\u001b[39mpydfu\u001b[38;5;241m.\u001b[39mcli_progress)\n",
162
+ "\u001b[1;31mNameError\u001b[0m: name 'pydfu' is not defined"
163
+ ]
164
+ }
165
+ ],
166
+ "source": [
167
+ "print(\"Writing memory...\")\n",
168
+ "pydfu.write_elements(elements, False, progress=pydfu.cli_progress)"
169
+ ]
170
+ },
171
+ {
172
+ "cell_type": "code",
173
+ "execution_count": null,
174
+ "metadata": {},
175
+ "outputs": [],
176
+ "source": [
177
+ "print(\"Exiting DFU...\")\n",
178
+ "pydfu.exit_dfu()"
179
+ ]
180
+ }
181
+ ],
182
+ "metadata": {
183
+ "kernelspec": {
184
+ "display_name": ".venv",
185
+ "language": "python",
186
+ "name": "python3"
187
+ },
188
+ "language_info": {
189
+ "codemirror_mode": {
190
+ "name": "ipython",
191
+ "version": 3
192
+ },
193
+ "file_extension": ".py",
194
+ "mimetype": "text/x-python",
195
+ "name": "python",
196
+ "nbconvert_exporter": "python",
197
+ "pygments_lexer": "ipython3",
198
+ "version": "3.11.7"
199
+ }
200
+ },
201
+ "nbformat": 4,
202
+ "nbformat_minor": 2
203
+ }