micropython-stubber 1.20.2__tar.gz → 1.20.5__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 (163) hide show
  1. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/PKG-INFO +5 -4
  2. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/pyproject.toml +4 -4
  3. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/ask_input.py +24 -14
  4. micropython_stubber-1.20.5/src/mpflash/mpflash/bootloader/__init__.py +36 -0
  5. micropython_stubber-1.20.5/src/mpflash/mpflash/bootloader/manual.py +102 -0
  6. micropython_stubber-1.20.5/src/mpflash/mpflash/bootloader/micropython.py +10 -0
  7. micropython_stubber-1.20.5/src/mpflash/mpflash/bootloader/touch1200.py +45 -0
  8. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/cli_download.py +1 -0
  9. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/cli_flash.py +16 -9
  10. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/cli_group.py +13 -6
  11. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/cli_list.py +6 -2
  12. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/cli_main.py +5 -2
  13. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/common.py +15 -2
  14. micropython_stubber-1.20.5/src/mpflash/mpflash/config.py +47 -0
  15. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/download.py +82 -16
  16. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/downloaded.py +28 -7
  17. micropython_stubber-1.20.5/src/mpflash/mpflash/errors.py +9 -0
  18. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash.py +10 -27
  19. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_uf2.py +4 -6
  20. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_uf2_boardid.py +2 -1
  21. micropython_stubber-1.20.5/src/mpflash/mpflash/flash_uf2_macos.py +34 -0
  22. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_uf2_windows.py +4 -4
  23. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/__init__.py +4 -0
  24. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/board_id.py +19 -3
  25. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/store.py +2 -1
  26. micropython_stubber-1.20.5/src/mpflash/mpflash/vendor/click_aliases.py +91 -0
  27. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/poetry.lock +102 -137
  28. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/pyproject.toml +1 -1
  29. micropython_stubber-1.20.5/src/stubber/__init__.py +3 -0
  30. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs.py +12 -4
  31. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_db.py +4 -5
  32. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_db_min.py +1 -1
  33. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  34. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_mem.py +4 -5
  35. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_mem_min.py +1 -1
  36. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  37. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_min.py +2 -2
  38. micropython_stubber-1.20.5/src/stubber/board/createstubs_mpy.mpy +0 -0
  39. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/modulelist.txt +9 -0
  40. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/bulk/mcu_stubber.py +0 -1
  41. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/_partials/__init__.py +0 -2
  42. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/candidates.py +7 -28
  43. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/enums.py +0 -6
  44. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/package.py +15 -46
  45. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/publish.py +1 -2
  46. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/lookup.py +7 -7
  47. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/reader.py +26 -27
  48. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/update_module_list.py +2 -26
  49. micropython_stubber-1.20.2/src/mpflash/mpflash/config.py +0 -21
  50. micropython_stubber-1.20.2/src/mpflash/mpflash/errors.py +0 -5
  51. micropython_stubber-1.20.2/src/mpflash/mpflash/flash_uf2_macos.py +0 -78
  52. micropython_stubber-1.20.2/src/stubber/__init__.py +0 -3
  53. micropython_stubber-1.20.2/src/stubber/board/createstubs_mpy.mpy +0 -0
  54. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/LICENSE +0 -0
  55. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/readme.md +0 -0
  56. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/README.md +0 -0
  57. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/libusb_flash.ipynb +0 -0
  58. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/__init__.py +0 -0
  59. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/add_firmware.py +0 -0
  60. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/connected.py +0 -0
  61. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_esp.py +0 -0
  62. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_stm32.py +0 -0
  63. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_stm32_cube.py +0 -0
  64. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_stm32_dfu.py +0 -0
  65. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/flash_uf2_linux.py +0 -0
  66. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/list.py +0 -0
  67. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/logger.py +0 -0
  68. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/add_boards.py +0 -0
  69. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/board.py +0 -0
  70. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpboard_id/board_info.zip +0 -0
  71. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpremoteboard/__init__.py +0 -0
  72. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpremoteboard/mpy_fw_info.py +0 -0
  73. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/mpremoteboard/runner.py +0 -0
  74. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/uf2disk.py +0 -0
  75. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/vendor/basicgit.py +0 -0
  76. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/vendor/dfu.py +0 -0
  77. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/vendor/pydfu.py +0 -0
  78. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/vendor/readme.md +0 -0
  79. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/vendor/versions.py +0 -0
  80. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/mpflash/worklist.py +0 -0
  81. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/mpflash/stm32_udev_rules.md +0 -0
  82. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/basicgit.py +0 -0
  83. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/board_info.csv +0 -0
  84. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/boot.py +0 -0
  85. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_lvgl.py +0 -0
  86. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_lvgl_min.py +0 -0
  87. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/createstubs_lvgl_mpy.mpy +0 -0
  88. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/fw_info.py +0 -0
  89. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/info.py +0 -0
  90. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/main.py +0 -0
  91. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/board/pyrightconfig.json +0 -0
  92. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/__init__.py +0 -0
  93. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/_partials/db_main.py +0 -0
  94. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/_partials/lvgl_main.py +0 -0
  95. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/_partials/modules_reader.py +0 -0
  96. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/add_comment.py +0 -0
  97. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/add_method.py +0 -0
  98. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/board.py +0 -0
  99. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/enrich.py +0 -0
  100. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/merge_docstub.py +0 -0
  101. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/modify_list.py +0 -0
  102. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/codemod/utils.py +0 -0
  103. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/__init__.py +0 -0
  104. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/build_cmd.py +0 -0
  105. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/cli.py +0 -0
  106. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/clone_cmd.py +0 -0
  107. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/config_cmd.py +0 -0
  108. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/enrich_folder_cmd.py +0 -0
  109. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/get_core_cmd.py +0 -0
  110. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/get_docstubs_cmd.py +0 -0
  111. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/get_frozen_cmd.py +0 -0
  112. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/get_mcu_cmd.py +0 -0
  113. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/merge_cmd.py +0 -0
  114. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/publish_cmd.py +0 -0
  115. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/stub_cmd.py +0 -0
  116. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/switch_cmd.py +0 -0
  117. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/commands/variants_cmd.py +0 -0
  118. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/cst_transformer.py +0 -0
  119. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/data/board_info.csv +0 -0
  120. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/data/board_info.json +0 -0
  121. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/data/micropython_tags.csv +0 -0
  122. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/data/requirements-core-micropython.txt +0 -0
  123. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/data/requirements-core-pycopy.txt +0 -0
  124. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/downloader.py +0 -0
  125. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/freeze/__init__.py +0 -0
  126. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/freeze/common.py +0 -0
  127. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/freeze/freeze_folder.py +0 -0
  128. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/freeze/freeze_manifest_2.py +0 -0
  129. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/freeze/get_frozen.py +0 -0
  130. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/get_cpython.py +0 -0
  131. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/get_lobo.py +0 -0
  132. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/minify.py +0 -0
  133. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/__init__.py +0 -0
  134. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/bump.py +0 -0
  135. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/database.py +0 -0
  136. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/defaults.py +0 -0
  137. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/helpers.py +0 -0
  138. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/merge_docstubs.py +0 -0
  139. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/missing_class_methods.py +0 -0
  140. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/pathnames.py +0 -0
  141. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/pypi.py +0 -0
  142. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/publish/stubpackage.py +0 -0
  143. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/__init__.py +0 -0
  144. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/classsort.py +0 -0
  145. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/output_dict.py +0 -0
  146. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/report_return.py +0 -0
  147. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/rst/rst_utils.py +0 -0
  148. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/stubber.py +0 -0
  149. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/stubs_from_docs.py +0 -0
  150. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/tools/__init__.py +0 -0
  151. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/tools/manifestfile.py +0 -0
  152. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/tools/readme.md +0 -0
  153. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/update_fallback.py +0 -0
  154. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/__init__.py +0 -0
  155. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/config.py +0 -0
  156. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/makeversionhdr.py +0 -0
  157. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/manifest.py +0 -0
  158. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/post.py +0 -0
  159. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/repos.py +0 -0
  160. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/stubmaker.py +0 -0
  161. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/typed_config_toml.py +0 -0
  162. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/utils/versions.py +0 -0
  163. {micropython_stubber-1.20.2 → micropython_stubber-1.20.5}/src/stubber/variants.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micropython-stubber
3
- Version: 1.20.2
3
+ Version: 1.20.5
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
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
16
17
  Classifier: Programming Language :: Python :: Implementation :: CPython
17
18
  Classifier: Programming Language :: Python :: Implementation :: MicroPython
18
19
  Classifier: Topic :: Software Development :: Build Tools
@@ -25,8 +26,8 @@ Requires-Dist: executing (>=2.0.1,<3.0.0)
25
26
  Requires-Dist: importlib-metadata (>=1.0,<2.0) ; python_version < "3.8"
26
27
  Requires-Dist: libcst (>=1.1.0,<2.0.0)
27
28
  Requires-Dist: loguru (>=0.6,<0.8)
28
- Requires-Dist: mpflash (>=0.7.4,<0.8.0)
29
- Requires-Dist: mpremote (>=1.22.0,<2.0.0)
29
+ Requires-Dist: mpflash (>=0.8.6,<0.9.0)
30
+ Requires-Dist: mpremote (>=1.23.0,<2.0.0)
30
31
  Requires-Dist: mypy (==1.9.0)
31
32
  Requires-Dist: mypy-gitlab-code-quality (>=1.1.0,<2.0.0)
32
33
  Requires-Dist: packaging (>=21.3,<24.0)
@@ -38,7 +39,7 @@ Requires-Dist: pyserial (>=3.5,<4.0)
38
39
  Requires-Dist: pysondb-v2 (>=2.1.0,<3.0.0)
39
40
  Requires-Dist: python-minifier (>=2.7.0,<3.0.0) ; python_version < "3.12"
40
41
  Requires-Dist: requests (>=2.28.0,<3.0.0)
41
- Requires-Dist: rich-click (>=1.7.3,<2.0.0)
42
+ Requires-Dist: rich-click (>=1.8.3,<2.0.0)
42
43
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
43
44
  Requires-Dist: tenacity (>=8.2.2,<9.0.0)
44
45
  Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
@@ -8,7 +8,7 @@ repo-path = "./repos"
8
8
 
9
9
  [tool.poetry]
10
10
  name = "micropython-stubber"
11
- version = "1.20.2"
11
+ version = "1.20.5"
12
12
  description = "Tooling to create and maintain stubs for MicroPython"
13
13
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
14
14
  license = "MIT"
@@ -49,8 +49,8 @@ python = ">=3.9,<4.0"
49
49
  python-minifier = { version = "^2.7.0", python = "<3.12" } # no support for 3.12 yet
50
50
  requests = "^2.28.0"
51
51
  mypy = "1.9.0"
52
- mpflash = "^0.7.4"
53
- mpremote = "^1.22.0"
52
+ mpflash = "^0.8.6"
53
+ mpremote = "^1.23.0"
54
54
  # others
55
55
  autoflake = ">=1.7,<3.0"
56
56
  black = ">=22.10,<25.0"
@@ -68,7 +68,7 @@ pyright = "^1.1.341"
68
68
  pyserial = "^3.5"
69
69
  pysondb-v2 = "^2.1.0"
70
70
  pypi-simple = "^1.0.0"
71
- rich-click = "^1.7.3"
71
+ rich-click = "^1.8.3"
72
72
  tabulate = "^0.9.0"
73
73
  tenacity = "^8.2.2"
74
74
  tomli = { version = "^2.0.1", python = "<3.11" }
@@ -11,7 +11,8 @@ from loguru import logger as log
11
11
 
12
12
  from .common import DownloadParams, FlashParams, ParamType
13
13
  from .config import config
14
- from .mpboard_id import get_known_boards_for_port, get_known_ports, known_stored_boards
14
+ from .mpboard_id import (get_known_boards_for_port, get_known_ports,
15
+ known_stored_boards)
15
16
  from .mpremoteboard import MPRemoteBoard
16
17
  from .vendor.versions import micropython_versions
17
18
 
@@ -28,6 +29,11 @@ def ask_missing_params(
28
29
  Returns:
29
30
  ParamType: The updated parameters.
30
31
  """
32
+ if not config.interactive:
33
+ # no interactivity allowed
34
+ log.info("Interactive mode disabled. Skipping ask for user input.")
35
+ return params
36
+
31
37
  import inquirer
32
38
 
33
39
  log.trace(f"ask_missing_params: {params}")
@@ -36,9 +42,6 @@ def ask_missing_params(
36
42
  # if action download, multiple input
37
43
  multi_select = isinstance(params, DownloadParams)
38
44
  action = "download" if isinstance(params, DownloadParams) else "flash"
39
- if not config.interactive:
40
- # no interactivity allowed
41
- return params
42
45
 
43
46
  questions = []
44
47
  answers: dict[str, Union[str, List]] = {"action": action}
@@ -67,8 +70,14 @@ def ask_missing_params(
67
70
  answers["serial"] = [answers["serial"]]
68
71
  params.serial = [s.split()[0] for s in answers["serial"]] # split to remove the description
69
72
  if "port" in answers:
70
- params.ports = [p for p in params.ports if p != "?"] # remove the "?" if present
71
- params.ports.extend(answers["port"])
73
+ # params.ports = [p for p in params.ports if p != "?"] # remove the "?" if present
74
+ if isinstance(answers["port"], str):
75
+ params.ports.append(answers["port"])
76
+ elif isinstance(answers["port"], list): # type: ignore
77
+ params.ports.extend(answers["port"])
78
+ else:
79
+ raise ValueError(f"Unexpected type for answers['port']: {type(answers['port'])}")
80
+
72
81
  if "boards" in answers:
73
82
  params.boards = [b for b in params.boards if b != "?"] # remove the "?" if present
74
83
  params.boards.extend(answers["boards"] if isinstance(answers["boards"], list) else [answers["boards"]])
@@ -152,10 +161,18 @@ def ask_port_board(*, multi_select: bool, action: str):
152
161
  "Which {port} board firmware do you want to {action} " + "to {serial} ?" if action == "flash" else "?"
153
162
  ),
154
163
  choices=filter_matching_boards,
155
- validate=lambda _, x: True if x else "Please select at least one board", # type: ignore
164
+ validate=at_least_one_validation, # type: ignore
165
+ # validate=lambda _, x: True if x else "Please select at least one board", # type: ignore
156
166
  ),
157
167
  ]
158
168
 
169
+ def at_least_one_validation(answers, current) -> bool:
170
+ import inquirer.errors
171
+ if not current:
172
+ raise inquirer.errors.ValidationError("", reason="Please select at least one item.")
173
+ if isinstance(current, list) and not any(current):
174
+ raise inquirer.errors.ValidationError("", reason="Please select at least one item.")
175
+ return True
159
176
 
160
177
  def ask_mp_version(multi_select: bool, action: str):
161
178
  """
@@ -181,13 +198,6 @@ def ask_mp_version(multi_select: bool, action: str):
181
198
  # todo: this may be a little slow
182
199
  mp_versions = [v for v in mp_versions if "preview" in v or get_known_boards_for_port("stm32", [v])]
183
200
 
184
- def at_least_one_validation(answers, current) -> bool:
185
- if not current:
186
- raise inquirer.errors.ValidationError("", reason="Please select at least one version")
187
- if isinstance(current, list) and not any(current):
188
- raise inquirer.errors.ValidationError("", reason="Please select at least one version")
189
- return True
190
-
191
201
  message = "Which version(s) do you want to {action} " + ("to {serial} ?" if action == "flash" else "?")
192
202
  q = input_ux(
193
203
  # inquirer.List(
@@ -0,0 +1,36 @@
1
+ import time
2
+
3
+ from mpflash.common import BootloaderMethod
4
+ from mpflash.errors import MPFlashError
5
+ from mpflash.logger import log
6
+ from mpflash.mpremoteboard import MPRemoteBoard
7
+
8
+ from .manual import enter_bootloader_manual
9
+ from .micropython import enter_bootloader_mpy
10
+ from .touch1200 import enter_bootloader_cdc_1200bps
11
+
12
+
13
+ def enter_bootloader(
14
+ mcu: MPRemoteBoard,
15
+ method: BootloaderMethod = BootloaderMethod.MPY,
16
+ timeout: int = 10,
17
+ wait_after: int = 2,
18
+ ):
19
+ """Enter the bootloader mode for the board"""
20
+ if method == BootloaderMethod.NONE:
21
+ # NO bootloader requested, so must be OK to flash
22
+ return True
23
+
24
+ log.info(f"Entering bootloader on {mcu.board} on {mcu.serialport} using method: {method.value}")
25
+ if method == BootloaderMethod.MPY:
26
+ result = enter_bootloader_mpy(mcu, timeout=timeout)
27
+ elif method == BootloaderMethod.MANUAL:
28
+ result = enter_bootloader_manual(mcu, timeout=timeout)
29
+ elif method == BootloaderMethod.TOUCH_1200:
30
+ result = enter_bootloader_cdc_1200bps(mcu, timeout=timeout)
31
+ else:
32
+ raise MPFlashError(f"Unknown bootloader method {method}")
33
+ if result:
34
+ time.sleep(wait_after)
35
+ log.error(f"Failed to enter bootloader on {mcu.serialport}")
36
+ return result
@@ -0,0 +1,102 @@
1
+ """Manual bootloader mode entry for various MCUs."""
2
+
3
+ from click.exceptions import Abort
4
+ from rich.console import Console
5
+ from rich.highlighter import RegexHighlighter
6
+ from rich.panel import Panel
7
+ from rich.prompt import Confirm
8
+ from rich.theme import Theme
9
+
10
+ # from mpflash.logger import console, log
11
+ from mpflash.mpremoteboard import MPRemoteBoard
12
+
13
+
14
+ class MCUHighlighter(RegexHighlighter):
15
+ """Apply style to anything that looks like an email."""
16
+
17
+ base_style = "mcu."
18
+ highlights = [
19
+ r"(?P<bold>Method[\s\d\:]*)",
20
+ r"(?P<bold> \d.)", # numbered items
21
+ r"(?P<bold> - )", # bullets
22
+ r"(?P<pad>GPIO[\d]*)",
23
+ r"(?P<pad>GPI[\d]*)",
24
+ r"(?P<pad>IO[\d]*)",
25
+ r"(?P<pad>RUN)",
26
+ r"(?P<pad>GND)",
27
+ r"(?P<pad>VCC)",
28
+ r"(?P<pad>3.3V)",
29
+ r"(?P<pad>5V)",
30
+ # buttons
31
+ r"(?P<button>BOOTSEL)",
32
+ r"(?P<button>RESET)",
33
+ r"(?P<button>reset)",
34
+ # other
35
+ r"(?P<cable>USB)",
36
+ # r"(?P<mcu>SAMD[\d]*)",
37
+ # r"(?P<mcu>ESP[\d]*)",
38
+ # r"(?P<mcu>rp2)",
39
+ # r"(?P<mcu>rp2040)",
40
+ ]
41
+
42
+
43
+ # https://rich.readthedocs.io/en/stable/appendix/colors.html?highlight=colors#standard-colors
44
+ mcu_theme = Theme(
45
+ {
46
+ "mcu.bold": "orange3",
47
+ "mcu.mcu": "orange3",
48
+ "mcu.button": "bold green",
49
+ "mcu.pad": "dodger_blue2",
50
+ "mcu.cable": "dodger_blue2",
51
+ }
52
+ )
53
+
54
+
55
+ def enter_bootloader_manual(mcu: MPRemoteBoard, timeout: int = 10):
56
+
57
+ message: str
58
+ if mcu.port == "rp2":
59
+ message = f"""\
60
+ Please put your {" ".join([mcu.port,mcu.board])} device into bootloader mode by either:
61
+ Method 1:
62
+ 1. Unplug the USB cable,
63
+ 2. Press and hold the BOOTSEL button on the device,
64
+ 3. Plug the USB cable back in.
65
+ 4. Release the BOOTSEL button.
66
+
67
+ Method 2:
68
+ 1. Press and hold the BOOTSEL button on the device,
69
+ 2. Reset the device by either:
70
+ - pressing the RESET button on the device
71
+ - by power-cycling the device,
72
+ - by briefly connecting the RUN pin to GND
73
+ 3. Release the BOOTSEL button.
74
+ """
75
+ elif mcu.port == "samd":
76
+ message = f"""\
77
+ Please put your {mcu.port.upper()} device into bootloader mode by:
78
+ - Pressing or sliding the RESET button twice in fast succession
79
+ """
80
+ else:
81
+ message = f"""\
82
+ Please put your {mcu.port.upper()} device into bootloader mode by:
83
+ - Pressing the RESET button on the device
84
+ """
85
+
86
+ # todo: would be nice to re-use the console instance from logger
87
+ console = Console(highlighter=MCUHighlighter(), theme=mcu_theme)
88
+ message += "\nIf you are unsure how to enter bootloader mode, please refer to the device documentation."
89
+ console.print(
90
+ Panel(
91
+ message,
92
+ highlight=True,
93
+ title="Manual Bootloader",
94
+ title_align="left",
95
+ expand=False,
96
+ )
97
+ )
98
+ try:
99
+ answer = Confirm.ask("Press Enter to continue", default="y")
100
+ except Abort:
101
+ return False
102
+ return answer in ["y", "Y", True]
@@ -0,0 +1,10 @@
1
+ """Module for handling the bootloader mode for micropython boards"""
2
+
3
+ from mpflash.mpremoteboard import MPRemoteBoard
4
+
5
+
6
+ def enter_bootloader_mpy(mcu: MPRemoteBoard, timeout: int = 10):
7
+ """Enter the bootloader mode for the board using mpremote and micropython on the board"""
8
+ mcu.run_command("bootloader", timeout=timeout)
9
+ # todo: check if mpremote command was successful
10
+ return True
@@ -0,0 +1,45 @@
1
+ import sys
2
+ import time
3
+
4
+ import serial
5
+
6
+ from mpflash.errors import MPFlashError
7
+ from mpflash.logger import log
8
+ from mpflash.mpremoteboard import MPRemoteBoard
9
+
10
+ from .manual import enter_bootloader_manual
11
+
12
+
13
+ def enter_bootloader_cdc_1200bps(mcu: MPRemoteBoard, timeout: int = 10):
14
+ if sys.platform == "win32":
15
+ log.warning("Touch 1200bps method is currently not supported on Windows, switching to manual")
16
+ return enter_bootloader_manual(mcu, timeout=timeout)
17
+
18
+ log.info(f"Entering bootloader on {mcu.board} on {mcu.serialport} using CDC 1200bps")
19
+ # if port argument is present perform soft reset
20
+ if not mcu.serialport:
21
+ raise MPFlashError("No serial port specified")
22
+ # try to initiate serial port connection on PORT with 1200 baudrate
23
+ try:
24
+ with serial.Serial(
25
+ port=mcu.serialport,
26
+ baudrate=1200,
27
+ parity=serial.PARITY_NONE,
28
+ stopbits=serial.STOPBITS_ONE,
29
+ bytesize=serial.EIGHTBITS,
30
+ rtscts=True,
31
+ ) as connection:
32
+ print("Connection established")
33
+ connection.rts = True
34
+ connection.dtr = False
35
+ time.sleep(0.4)
36
+
37
+ except serial.SerialException as e:
38
+ log.exception(e)
39
+ raise MPFlashError("pySerial error: " + str(e) + "\n") from e
40
+ except Exception as e:
41
+ log.exception(e)
42
+ raise MPFlashError("Error: " + str(e) + "\n") from e
43
+
44
+ # be optimistic
45
+ return True
@@ -80,6 +80,7 @@ from .download import download
80
80
  )
81
81
  @click.option(
82
82
  "--force",
83
+ "-f",
83
84
  default=False,
84
85
  is_flag=True,
85
86
  show_default=True,
@@ -4,7 +4,7 @@ from typing import List
4
4
  import rich_click as click
5
5
  from loguru import logger as log
6
6
 
7
- # from mpflash.common import filtered_comports
7
+ from mpflash.common import BootloaderMethod
8
8
  from mpflash.errors import MPFlashError
9
9
  from mpflash.mpboard_id import find_known_board
10
10
  from mpflash.mpremoteboard import MPRemoteBoard
@@ -17,7 +17,8 @@ from .cli_list import show_mcus
17
17
  from .common import FlashParams
18
18
  from .config import config
19
19
  from .flash import flash_list
20
- from .worklist import WorkList, full_auto_worklist, manual_worklist, single_auto_worklist
20
+ from .worklist import (WorkList, full_auto_worklist, manual_worklist,
21
+ single_auto_worklist)
21
22
 
22
23
  # #########################################################################################################
23
24
  # CLI
@@ -101,11 +102,13 @@ from .worklist import WorkList, full_auto_worklist, manual_worklist, single_auto
101
102
  help="""Erase flash before writing new firmware. (Not supported on UF2 boards)""",
102
103
  )
103
104
  @click.option(
104
- "--bootloader/--no-bootloader",
105
- default=True,
106
- is_flag=True,
105
+ "--bootloader",
106
+ "-b",
107
+ "bootloader",
108
+ type=click.Choice([e.value for e in BootloaderMethod]),
109
+ default="mpy",
107
110
  show_default=True,
108
- help="""Enter micropython bootloader mode before flashing.""",
111
+ help="""How to enter the (MicroPython) bootloader before flashing.""",
109
112
  )
110
113
  def cli_flash_board(**kwargs) -> int:
111
114
  # version to versions, board to boards
@@ -118,9 +121,11 @@ def cli_flash_board(**kwargs) -> int:
118
121
 
119
122
  params = FlashParams(**kwargs)
120
123
  params.versions = list(params.versions)
121
- params.boards = list(params.boards)
124
+ params.ports = list(params.ports)
125
+ params.boards = list(params.boards)
122
126
  params.serial = list(params.serial)
123
127
  params.ignore = list(params.ignore)
128
+ params.bootloader = BootloaderMethod(params.bootloader)
124
129
 
125
130
  # make it simple for the user to flash one board by asking for the serial port if not specified
126
131
  if params.boards == ["?"] and params.serial == "*":
@@ -129,14 +134,16 @@ def cli_flash_board(**kwargs) -> int:
129
134
  # Detect connected boards if not specified,
130
135
  # and ask for input if boards cannot be detected
131
136
  all_boards: List[MPRemoteBoard] = []
132
- if not params.boards or params.boards == []:
137
+ if not params.boards:
133
138
  # nothing specified - detect connected boards
134
139
  params.ports, params.boards, all_boards = connected_ports_boards(include=params.ports, ignore=params.ignore)
135
140
  if params.boards == []:
136
- # No MicroPython boards detected, but it could be unflashed or not in bootloader mode
141
+ # No MicroPython boards detected, but it could be unflashed or in bootloader mode
137
142
  # Ask for serial port and board_id to flash
138
143
  params.serial = ["?"]
139
144
  params.boards = ["?"]
145
+ # assume manual mode if no board is detected
146
+ params.bootloader = BootloaderMethod("manual")
140
147
  else:
141
148
  resolve_board_ids(params)
142
149
 
@@ -5,43 +5,50 @@ Additional comands are added in the submodules.
5
5
 
6
6
  import rich_click as click
7
7
 
8
- from .config import config
9
- from .logger import make_quiet, set_loglevel
8
+ from mpflash.vendor.click_aliases import ClickAliasedGroup
9
+
10
+ from .config import __version__, config
11
+ from .logger import log, make_quiet, set_loglevel
10
12
 
11
13
 
12
14
  def cb_verbose(ctx, param, value):
13
15
  """Callback to set the log level to DEBUG if verbose is set"""
14
16
  if value and not config.quiet:
17
+ # log.debug(f"Setting verbose mode to {value}")
15
18
  config.verbose = True
16
19
  if value > 1:
17
20
  set_loglevel("TRACE")
18
21
  else:
19
22
  set_loglevel("DEBUG")
23
+ log.debug(f"version: {__version__}")
20
24
  else:
21
25
  set_loglevel("INFO")
22
26
  config.verbose = False
23
27
  return value
24
28
 
25
29
 
26
- def cb_interactive(ctx, param, value):
27
- if value:
28
- config.interactive = value
30
+ def cb_interactive(ctx, param, value:bool):
31
+ log.trace(f"Setting interactive mode to {value}")
32
+ config.interactive = value
29
33
  return value
30
34
 
31
35
 
32
36
  def cb_test(ctx, param, value):
33
37
  if value:
38
+ log.trace(f"Setting tests to {value}")
34
39
  config.tests = value
35
40
  return value
36
41
 
37
42
 
38
43
  def cb_quiet(ctx, param, value):
44
+ log.trace(f"Setting quiet mode to {value}")
39
45
  if value:
40
46
  make_quiet()
41
47
  return value
42
48
 
43
49
 
44
- @click.group()
50
+ @click.group(cls=ClickAliasedGroup)
51
+ # @click.group()
45
52
  @click.version_option(package_name="mpflash")
46
53
  @click.option(
47
54
  "--quiet",
@@ -5,12 +5,16 @@ import rich_click as click
5
5
  from rich import print
6
6
 
7
7
  from .cli_group import cli
8
+ from .connected import list_mcus
8
9
  from .list import show_mcus
9
10
  from .logger import make_quiet
10
- from .connected import list_mcus
11
11
 
12
12
 
13
- @cli.command("list", help="List the connected MCU boards.")
13
+ @cli.command(
14
+ "list",
15
+ help="List the connected MCU boards. alias: devs",
16
+ aliases=["devs"],
17
+ )
14
18
  @click.option(
15
19
  "--json",
16
20
  "-j",
@@ -19,12 +19,12 @@ def mpflash():
19
19
  cli.add_command(cli_flash_board)
20
20
 
21
21
  # cli(auto_envvar_prefix="MPFLASH")
22
- if False and os.environ.get("COMPUTERNAME") == "JOSVERL-S4":
22
+ if False and os.environ.get("COMPUTERNAME").startswith("JOSVERL"):
23
23
  # intentional less error suppression on dev machine
24
24
  result = cli(standalone_mode=False)
25
25
  else:
26
26
  try:
27
- result = cli(standalone_mode=False)
27
+ result = cli(standalone_mode=True)
28
28
  exit(result)
29
29
  except AttributeError as e:
30
30
  log.error(f"Error: {e}")
@@ -32,6 +32,9 @@ def mpflash():
32
32
  except click.exceptions.ClickException as e:
33
33
  log.error(f"Error: {e}")
34
34
  exit(-2)
35
+ except click.exceptions.Abort as e:
36
+ # Aborted - Ctrl-C
37
+ exit(-3)
35
38
 
36
39
 
37
40
  if __name__ == "__main__":
@@ -2,6 +2,7 @@ import fnmatch
2
2
  import os
3
3
  import sys
4
4
  from dataclasses import dataclass, field
5
+ from enum import Enum
5
6
  from pathlib import Path
6
7
  from typing import List, Optional, Union
7
8
 
@@ -47,7 +48,7 @@ class FWInfo:
47
48
  firmware: str = field(default="") # url or path to original firmware image
48
49
  variant: str = field(default="") # MicroPython variant
49
50
  preview: bool = field(default=False) # True if the firmware is a preview version
50
- version: str = field(default="") # MicroPython version
51
+ version: str = field(default="") # MicroPython version (NO v prefix)
51
52
  url: str = field(default="") # url to the firmware image download folder
52
53
  build: str = field(default="0") # The build = number of commits since the last release
53
54
  ext: str = field(default="") # the file extension of the firmware
@@ -90,14 +91,26 @@ class DownloadParams(Params):
90
91
  force: bool = False
91
92
 
92
93
 
94
+ class BootloaderMethod(Enum):
95
+ MANUAL = "manual"
96
+ MPY = "mpy"
97
+ TOUCH_1200 = "touch1200"
98
+ NONE = "none"
99
+
100
+
101
+
93
102
  @dataclass
94
103
  class FlashParams(Params):
95
104
  """Parameters for flashing a board"""
96
105
 
97
106
  erase: bool = True
98
- bootloader: bool = True
107
+ bootloader: BootloaderMethod = BootloaderMethod.NONE
99
108
  cpu: str = ""
100
109
 
110
+ def __post_init__(self):
111
+ if isinstance(self.bootloader, str):
112
+ self.bootloader = BootloaderMethod(self.bootloader)
113
+
101
114
 
102
115
  ParamType = Union[DownloadParams, FlashParams]
103
116
 
@@ -0,0 +1,47 @@
1
+ """centralized configuration for mpflash"""
2
+
3
+ import os
4
+ from pathlib import Path
5
+ from typing import List
6
+
7
+ import pkg_resources
8
+ import platformdirs
9
+
10
+ from mpflash.logger import log
11
+
12
+
13
+ def get_version():
14
+ name = __package__ or "mpflash"
15
+ try:
16
+ return pkg_resources.get_distribution(name).version
17
+ except pkg_resources.DistributionNotFound:
18
+ return "Package not found"
19
+
20
+
21
+ class MPtoolConfig:
22
+ """Centralized configuration for mpflash"""
23
+
24
+ quiet: bool = False
25
+ verbose: bool = False
26
+ ignore_ports: List[str] = []
27
+ firmware_folder: Path = platformdirs.user_downloads_path() / "firmware"
28
+ # test options specified on the commandline
29
+ tests: List[str] = []
30
+ _interactive: bool = True
31
+
32
+ @property
33
+ def interactive(self):
34
+ # No interactions in CI
35
+ if os.getenv('GITHUB_ACTIONS') == 'true':
36
+ log.warning("Disabling interactive mode in CI")
37
+ return False
38
+ return self._interactive
39
+
40
+ @interactive.setter
41
+ def interactive(self, value:bool):
42
+ self._interactive = value
43
+
44
+
45
+
46
+ config = MPtoolConfig()
47
+ __version__ = get_version()