micropython-stubber 1.13.7__tar.gz → 1.13.8__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 (111) hide show
  1. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/PKG-INFO +1 -1
  2. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/pyproject.toml +20 -1
  3. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/setup.py +1 -1
  4. micropython_stubber-1.13.8/src/stubber/__init__.py +4 -0
  5. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/basicgit.py +10 -7
  6. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs.py +4 -3
  7. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_db.py +5 -4
  8. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_db_min.py +33 -33
  9. micropython_stubber-1.13.8/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  10. micropython_stubber-1.13.8/src/stubber/board/createstubs_info.py +906 -0
  11. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_lvgl.py +5 -4
  12. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_lvgl_min.py +41 -41
  13. micropython_stubber-1.13.8/src/stubber/board/createstubs_lvgl_mpy.mpy +0 -0
  14. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_mem.py +5 -4
  15. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_mem_min.py +48 -48
  16. micropython_stubber-1.13.8/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  17. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/createstubs_min.py +41 -41
  18. micropython_stubber-1.13.8/src/stubber/board/createstubs_mpy.mpy +0 -0
  19. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/board.py +1 -1
  20. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/cli.py +1 -1
  21. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/switch_cmd.py +8 -1
  22. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/data/micropython_tags.csv +1 -1
  23. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/get_cpython.py +3 -1
  24. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/enums.py +8 -0
  25. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/publish.py +5 -3
  26. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/stubpacker.py +7 -7
  27. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/lookup.py +1 -1
  28. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/manifest.py +1 -1
  29. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/repos.py +22 -9
  30. micropython_stubber-1.13.7/src/stubber/__init__.py +0 -3
  31. micropython_stubber-1.13.7/src/stubber/board/createstubs_db_mpy.mpy +0 -0
  32. micropython_stubber-1.13.7/src/stubber/board/createstubs_lvgl_mpy.mpy +0 -0
  33. micropython_stubber-1.13.7/src/stubber/board/createstubs_mem_mpy.mpy +0 -0
  34. micropython_stubber-1.13.7/src/stubber/board/createstubs_mpy.mpy +0 -0
  35. micropython_stubber-1.13.7/src/stubber/utils/my_version.py +0 -15
  36. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/LICENSE +0 -0
  37. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/readme.md +0 -0
  38. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/board_info.csv +0 -0
  39. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/boot.py +0 -0
  40. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/logging.py +0 -0
  41. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/main.py +0 -0
  42. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/modulelist.txt +0 -0
  43. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/board/pyrightconfig.json +0 -0
  44. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/__init__.py +0 -0
  45. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/_partials/__init__.py +0 -0
  46. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/_partials/db_main.py +0 -0
  47. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/_partials/lvgl_main.py +0 -0
  48. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/_partials/modules_reader.py +0 -0
  49. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/add_comment.py +0 -0
  50. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/add_method.py +0 -0
  51. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/enrich.py +0 -0
  52. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/merge_docstub.py +0 -0
  53. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/modify_list.py +0 -0
  54. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/codemod/utils.py +0 -0
  55. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/__init__.py +0 -0
  56. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/build_cmd.py +0 -0
  57. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/clone_cmd.py +0 -0
  58. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/config_cmd.py +0 -0
  59. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/enrich_folder_cmd.py +0 -0
  60. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/get_core_cmd.py +0 -0
  61. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/get_docstubs_cmd.py +0 -0
  62. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/get_frozen_cmd.py +0 -0
  63. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/get_lobo_cmd.py +0 -0
  64. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/merge_cmd.py +0 -0
  65. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/minify_cmd.py +0 -0
  66. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/publish_cmd.py +0 -0
  67. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/stub_cmd.py +0 -0
  68. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/upd_fallback_cmd.py +0 -0
  69. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/upd_module_list_cmd.py +0 -0
  70. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/commands/variants_cmd.py +0 -0
  71. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/cst_transformer.py +0 -0
  72. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/data/board_info.json +0 -0
  73. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/data/requirements-core-micropython.txt +0 -0
  74. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/data/requirements-core-pycopy.txt +0 -0
  75. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/downloader.py +0 -0
  76. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/freeze/__init__.py +0 -0
  77. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/freeze/common.py +0 -0
  78. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/freeze/freeze_folder.py +0 -0
  79. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/freeze/freeze_manifest_2.py +0 -0
  80. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/freeze/get_frozen.py +0 -0
  81. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/get_lobo.py +0 -0
  82. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/minify.py +0 -0
  83. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/__init__.py +0 -0
  84. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/bump.py +0 -0
  85. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/candidates.py +0 -0
  86. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/database.py +0 -0
  87. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/merge_docstubs.py +0 -0
  88. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/missing_class_methods.py +0 -0
  89. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/package.py +0 -0
  90. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/publish/pypi.py +0 -0
  91. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/__init__.py +0 -0
  92. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/classsort.py +0 -0
  93. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/output_dict.py +0 -0
  94. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/reader.py +0 -0
  95. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/report_return.py +0 -0
  96. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/rst/rst_utils.py +0 -0
  97. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/stubber.py +0 -0
  98. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/stubs_from_docs.py +0 -0
  99. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/tools/__init__.py +0 -0
  100. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/tools/manifestfile.py +0 -0
  101. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/tools/readme.md +0 -0
  102. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/update_fallback.py +0 -0
  103. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/update_module_list.py +0 -0
  104. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/__init__.py +0 -0
  105. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/config.py +0 -0
  106. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/makeversionhdr.py +0 -0
  107. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/post.py +0 -0
  108. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/stubmaker.py +0 -0
  109. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/typed_config_toml.py +0 -0
  110. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/utils/versions.py +0 -0
  111. {micropython_stubber-1.13.7 → micropython_stubber-1.13.8}/src/stubber/variants.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micropython-stubber
3
- Version: 1.13.7
3
+ Version: 1.13.8
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
@@ -8,7 +8,7 @@ repo-path = "./repos"
8
8
 
9
9
  [tool.poetry]
10
10
  name = "micropython-stubber"
11
- version = "1.13.7"
11
+ version = "1.13.8"
12
12
  description = "Tooling to create and maintain stubs for MicroPython"
13
13
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
14
14
  license = "MIT"
@@ -96,11 +96,30 @@ pytest-metadata = "^2.0.2"
96
96
  pytest-mock = "^3.10.0"
97
97
  sourcery-cli = "^1.0.3"
98
98
  mpremote = { git = "https://github.com/Josverl/mpremote", subdirectory = "tools/mpremote", optional = true }
99
+ ipykernel = "^6.23.1"
99
100
 
100
101
  [build-system]
101
102
  requires = ["poetry-core>=1.0.0"]
102
103
  build-backend = "poetry.core.masonry.api"
103
104
 
105
+ [tool.poetry_bumpversion.file."src/stubber/__init__.py"]
106
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs.py"]
107
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs_mem.py"]
108
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs_db.py"]
109
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs_min.py"]
110
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs_mem_min.py"]
111
+ [tool.poetry_bumpversion.file."src/stubber/board/createstubs_db_min.py"]
112
+
113
+ [[tool.poetry_bumpversion.replacements]]
114
+ files = [
115
+ "package.json",
116
+ "mip/full.json",
117
+ "mip/minified.json",
118
+ "mip/mpy_v5.json",
119
+ "mip/mpy_v6.json",
120
+ ]
121
+ search = '"version": "{current_version}"'
122
+ replace = '"version": "{new_version}"'
104
123
 
105
124
  [tool.pyright]
106
125
  include = ["src", "tests"]
@@ -51,7 +51,7 @@ entry_points = \
51
51
 
52
52
  setup_kwargs = {
53
53
  'name': 'micropython-stubber',
54
- 'version': '1.13.7',
54
+ 'version': '1.13.8',
55
55
  'description': 'Tooling to create and maintain stubs for MicroPython',
56
56
  'long_description': '# Boost MicroPython productivity in VSCode\n \n [![pypi version](https://badgen.net/pypi/v/micropython-stubber)](https://pypi.org/project/micropython-stubber/)\n [![python versions](https://badgen.net/pypi/python/micropython-stubber)](https://badgen.net/pypi/python/micropython-stubber)\n [![Documentation Status](https://readthedocs.org/projects/micropython-stubber/badge/?version=latest)](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")\n [![Star on GitHub](https://img.shields.io/github/stars/josverl/micropython-stubber.svg?style=social)](https://github.com/josverl/micropython-stubber/stargazers)\n [![All Contributors](https://img.shields.io/badge/all_contributors-19-green.svg?style=flat-square)](#Contributions)\n <!-- break -->\n [![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)\n [![codecov](https://codecov.io/gh/Josverl/micropython-stubber/branch/main/graph/badge.svg?token=WJFGMKBHOV)](https://codecov.io/gh/Josverl/micropython-stubber)\n [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black "Black badge")\n <!-- break -->\n [![Open in VSCode](https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc\n)](https://open.vscode.dev/josverl/micropython-stubber)\n \nThe intellisense and code linting that is so prevalent in modern editors, does not work out-of-the-gate for MicroPython projects.\nWhile the language is Python, the modules used are different from CPython , and also different ports have different modules and classes , or the same class with different parameters.\n\nWriting MicroPython code in a modern editor should not need to involve keeping a browser open to check for the exact parameters to read a sensor, light-up a led or send a network request.\n\nFortunately with some additional configuration and data, it is possible to make the editors understand your flavor of MicroPython, wether you use one of the pre-compiled firmwares, but also if you run a one-off custom firmware version.\n\n\n![demo][]]\n\nIn order to achieve this a few things are needed:\n1) Stub files for the native / enabled modules in the firmware using PEP 484 Type Hints\n2) Specific configuration of the VSCode Python extensions \n3) Specific configuration of Pylint [ Optional ]\n4) Suppression of warnings that collide with the MicroPython principals or code optimization.\n\nPlease review the documentation on [https://micropython-stubber.readthedocs.io] \n\nWith that in place, VSCode will understand MicroPython for the most part, and help you to write code, and catch more errors before deploying it to your board. \n\nNote that the above is not limited to VSCode and pylint, but it happens to be the combination that I use. \n\nA lot of subs have already been generated and are shared on github or other means, so it is quite likely that you can just grab a copy be be productive in a few minutes.\n\nFor now you will need to [configure this by hand](#manual-configuration), or use the [micropy cli` tool](#using-micropy-cli)\n\n1. The sister-repo [**MicroPython-stubs**][stubs-repo] contains [all stubs][all-stubs] I have collected with the help of others, and which can be used directly.\nThat repo also contains examples configuration files that can be easily adopted to your setup.\n\n2. A second repo [micropy-stubs repo][stubs-repo2] maintained by BradenM, also contains stubs, but in a structure only used and distributed by the [micropy-cli](#using-micropy-cli) tool.\nYou should use micropy-cli to consume stubs from that repo.\n\nThe (stretch) goal is to create a VSCode add-in to simplify the configuration, and allow easy switching between different firmwares and versions.\n\n\n## Install and basic usage\n\n``` sh\npip install micropython-stubber\n\n# go to your working folder \ncd my_stub_folder\nmkdir all-stubs\n\n# clone the micropython repo\'s and switch to a specific version \nstubber clone\nstubber switch --version v1.18\n\n# get the document stubs for the current version ( v1.18 )\nstubber get-docstubs\n\n# get the frozen stubs for the current version ( v1.18 )\nstubber get-frozen\n\n# get the core CPython compatibility stubs from PyPi \nstubber get-core\n\n# Update the fallback stubs\nstubber update-fallback\n\n#\nls all-stubs\ndir all-stubs\n```\n\n\n## Developing & testing \n\nThis is described in more detail in the [developing](docs/developing.md) and [testing](docs/testing.md) documents in the docs folder.\n\n## Branch Main\nThe name of the default branch has been changed to `main`.\nIf you have cloned this repo before you main need to adjust the local repro to be aware of this, or create a fresh clone.\n\nTo update run the below command: \n``` bash\ngit branch -m master main \ngit fetch origin\ngit branch -u origin/main main \ngit remote set-head origin -a\n```\n\nfor more info see [**Renaming a branch**](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch#updating-a-local-clone-after-a-branch-name-changes)\n\n## Licensing \n\nMicroPython-Stubber is licensed under the MIT license, and all contributions should follow this [LICENSE](LICENSE).\n\n\n# Contributions\n<!-- spell-checker: disable -->\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n <tr>\n <td align="center"><a href="https://github.com/Josverl"><img src="https://avatars2.githubusercontent.com/u/981654?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jos Verlinde</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/commits?author=josverl" title="Code">💻</a> <a href="#research-josverl" title="Research">🔬</a> <a href="#ideas-josverl" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-josverl" title="Content">🖋</a> <a href="#stubs-josverl" title="MicroPython stubs">📚</a> <a href="#test-josverl" title="Test">✔</a></td>\n <td align="center"><a href="https://thonny.org/"><img src="https://avatars1.githubusercontent.com/u/46202078?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thonny, Python IDE for beginners</b></sub></a><br /><a href="#ideas-thonny" title="Ideas, Planning, & Feedback">🤔</a> <a href="#research-thonny" title="Research">🔬</a></td>\n <td align="center"><a href="https://micropython.org/"><img src="https://avatars1.githubusercontent.com/u/6298560?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MicroPython</b></sub></a><br /><a href="#data-micropython" title="Data">🔣</a> <a href="#stubs-micropython" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://github.com/loboris"><img src="https://avatars3.githubusercontent.com/u/6280349?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Boris Lovosevic</b></sub></a><br /><a href="#data-loboris" title="Data">🔣</a> <a href="#stubs-loboris" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://github.com/pfalcon"><img src="https://avatars3.githubusercontent.com/u/500451?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Sokolovsky</b></sub></a><br /><a href="#data-pfalcon" title="Data">🔣</a> <a href="#stubs-pfalcon" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://github.com/pycopy"><img src="https://avatars0.githubusercontent.com/u/67273174?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pycopy</b></sub></a><br /><a href="#data-pycopy" title="Data">🔣</a> <a href="#stubs-pycopy" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://github.com/pycom"><img src="https://avatars2.githubusercontent.com/u/16415153?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pycom</b></sub></a><br /><a href="#infra-pycom" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>\n </tr>\n <tr>\n <td align="center"><a href="https://github.com/BradenM"><img src="https://avatars1.githubusercontent.com/u/5913808?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Braden Mars</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3ABradenM" title="Bug reports">🐛</a> <a href="https://github.com/Josverl/micropython-stubber/commits?author=BradenM" title="Code">💻</a> <a href="#stubs-BradenM" title="MicroPython stubs">📚</a> <a href="#platform-BradenM" title="Packaging/porting to new platform">📦</a></td>\n <td align="center"><a href="https://binary.com.au/"><img src="https://avatars2.githubusercontent.com/u/175909?v=4?s=100" width="100px;" alt=""/><br /><sub><b>James Manners</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/commits?author=jmannau" title="Code">💻</a> <a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3Ajmannau" title="Bug reports">🐛</a></td>\n <td align="center"><a href="http://patrickwalters.us/"><img src="https://avatars0.githubusercontent.com/u/4002194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3Aaskpatrickw" title="Bug reports">🐛</a> <a href="https://github.com/Josverl/micropython-stubber/commits?author=askpatrickw" title="Code">💻</a> <a href="#stubs-askpatrickw" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://opencollective.com/pythonseverywhere"><img src="https://avatars3.githubusercontent.com/u/16009100?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul m. p. P.</b></sub></a><br /><a href="#ideas-pmp-p" title="Ideas, Planning, & Feedback">🤔</a> <a href="#research-pmp-p" title="Research">🔬</a></td>\n <td align="center"><a href="https://github.com/edreamleo"><img src="https://avatars0.githubusercontent.com/u/592928?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Edward K. Ream</b></sub></a><br /><a href="#plugin-edreamleo" title="Plugin/utility libraries">🔌</a></td>\n <td align="center"><a href="https://github.com/dastultz"><img src="https://avatars3.githubusercontent.com/u/4334042?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daryl Stultz</b></sub></a><br /><a href="#stubs-dastultz" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://github.com/cabletie"><img src="https://avatars1.githubusercontent.com/u/2356734?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Keeping things together</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3Acabletie" title="Bug reports">🐛</a></td>\n </tr>\n <tr>\n <td align="center"><a href="https://github.com/vbolshakov"><img src="https://avatars2.githubusercontent.com/u/2453324?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vbolshakov</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3Avbolshakov" title="Bug reports">🐛</a> <a href="#stubs-vbolshakov" title="MicroPython stubs">📚</a></td>\n <td align="center"><a href="https://lemariva.com/"><img src="https://avatars2.githubusercontent.com/u/15173329?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mauro Riva</b></sub></a><br /><a href="#blog-lemariva" title="Blogposts">📝</a> <a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3Alemariva" title="Bug reports">🐛</a></td>\n <td align="center"><a href="https://github.com/MathijsNL"><img src="https://avatars0.githubusercontent.com/u/1612886?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MathijsNL</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3AMathijsNL" title="Bug reports">🐛</a></td>\n <td align="center"><a href="http://comingsoon.tm/"><img src="https://avatars0.githubusercontent.com/u/13251689?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Callum Jacob Hays</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3ACallumJHays" title="Bug reports">🐛</a> <a href="#test-CallumJHays" title="Test">✔</a></td>\n <td align="center"><a href="https://github.com/v923z"><img src="https://avatars0.githubusercontent.com/u/1310472?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zoltán Vörös</b></sub></a><br /><a href="#data-v923z" title="Data">🔣</a></td>\n <td align="center"><a href="https://github.com/vincent-l-j"><img src="https://avatars.githubusercontent.com/u/20021376?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vincent-l-j</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/commits?author=vincent-l-j" title="Documentation">📖</a></td>\n <td align="center"><a href="https://github.com/yegorLitvinov"><img src="https://avatars.githubusercontent.com/u/20367310?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Egor Litvinov</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/issues?q=author%3AyegorLitvinov" title="Bug reports">🐛</a></td>\n </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n----------------------------\n\n--------------------------------\n\n\n\n[stubs-repo]: https://github.com/Josverl/micropython-stubs\n[stubs-repo2]: https://github.com/BradenM/micropy-stubs\n[micropython-stubber]: https://github.com/Josverl/micropython-stubber\n[micropython-stubs]: https://github.com/Josverl/micropython-stubs#micropython-stubs\n[micropy-cli]: https://github.com/BradenM/micropy-cli\n[using-the-stubs]: https://github.com/Josverl/micropython-stubs#using-the-stubs\n[demo]: https://github.com/Josverl/micropython-stubber/blob/main/docs/img/demo.gif?raw=true\t"demo of writing code using the stubs"\n[stub processing order]: https://github.com/Josverl/micropython-stubber/blob/main/docs/img/stuborder_pylance.png?raw=true\t"recommended stub processing order"\n[naming-convention]: #naming-convention-and-stub-folder-structure\n[all-stubs]: https://github.com/Josverl/micropython-stubs/blob/main/firmwares.md\n[micropython]: https://github.com/micropython/micropython\n[micropython-lib]: https://github.com/micropython/micropython-lib\n[pycopy]: https://github.com/pfalcon/pycopy\n[pycopy-lib]: https://github.com/pfalcon/pycopy-lib\n\n',
57
57
  'author': 'Jos Verlinde',
@@ -0,0 +1,4 @@
1
+ """get the version"""
2
+
3
+
4
+ __version__ = "1.13.8"
@@ -3,18 +3,16 @@ Simple Git module, where needed via powershell
3
3
 
4
4
  Some of the functions are based on the gitpython module
5
5
  """
6
+ import os
6
7
  import subprocess
7
8
  from pathlib import Path
8
9
  from typing import List, Optional, Union
9
10
 
11
+ import cachetools.func
12
+ from github import Github
10
13
  from loguru import logger as log
11
14
  from packaging.version import parse
12
15
 
13
- from github import Github
14
- import cachetools.func
15
- import os
16
-
17
-
18
16
  # Token with no permissions
19
17
  PAT_NO_ACCESS = "github_pat" + "_11AAHPVFQ0IwtAmfc3cD5Z" + "_xOVII22ErRzzZ7xwwxRcNotUu4krMMbjinQcsMxjnWkYFBIDRWFlZMaHSqq"
20
18
  PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
@@ -122,9 +120,14 @@ def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
122
120
  """
123
121
  Get list of tag of a repote github repo
124
122
  """
125
- if not repo or not isinstance(repo, str) or "/" not in repo: # type: ignore
123
+ if not repo or not isinstance(repo, str) or "/" not in repo: # type: ignore
124
+ return []
125
+ try:
126
+ gh_repo = GH_CLIENT.get_repo(repo)
127
+ except ConnectionError as e:
128
+ # TODO: unable to capture the exeption
129
+ log.warning(f"Unable to get tags - {e}")
126
130
  return []
127
- gh_repo = GH_CLIENT.get_repo(repo)
128
131
  tags = [tag.name for tag in gh_repo.get_tags()]
129
132
  if minver:
130
133
  tags = [tag for tag in tags if parse(tag) >= parse(minver)]
@@ -20,7 +20,7 @@ try:
20
20
  except ImportError:
21
21
  from ucollections import OrderedDict # type: ignore
22
22
 
23
- __version__ = "v1.13.4"
23
+ __version__ = "v1.13.8"
24
24
  ENOENT = 2
25
25
  _MAX_CLASS_LEVEL = 2 # Max class nesting
26
26
  LIBS = [".", "/lib", "/sd/lib", "/flash/lib", "lib"]
@@ -90,7 +90,7 @@ class Stubber:
90
90
  _errors = []
91
91
  self._log.debug("get attributes {} {}".format(repr(item_instance), item_instance))
92
92
  for name in dir(item_instance):
93
- if name.startswith("_"):
93
+ if name.startswith("_") and not name in self.modules:
94
94
  continue
95
95
  self._log.debug("get attribute {}".format(name))
96
96
  try:
@@ -117,7 +117,8 @@ class Stubber:
117
117
  reset()
118
118
 
119
119
  # remove internal __
120
- _result = sorted([i for i in _result if not (i[0].startswith("_"))], key=lambda x: x[4])
120
+ # _result = sorted([i for i in _result if not (i[0].startswith("_"))], key=lambda x: x[4])
121
+ _result = sorted([i for i in _result if not (i[0].startswith("__"))], key=lambda x: x[4])
121
122
  gc.collect()
122
123
  return _result, _errors
123
124
 
@@ -18,7 +18,7 @@ Create stubs for (all) modules on a MicroPython board.
18
18
  - cross compilation, using mpy-cross, to avoid the compilation step on the micropython device
19
19
 
20
20
 
21
- This variant was generated from createstubs.py by micropython-stubber v1.13.4
21
+ This variant was generated from createstubs.py by micropython-stubber v1.13.8
22
22
  """
23
23
  # Copyright (c) 2019-2023 Jos Verlinde
24
24
  # pylint: disable= invalid-name, missing-function-docstring, import-outside-toplevel, logging-not-lazy
@@ -39,7 +39,7 @@ try:
39
39
  except ImportError:
40
40
  from ucollections import OrderedDict # type: ignore
41
41
 
42
- __version__ = "v1.13.4"
42
+ __version__ = "v1.13.8"
43
43
  ENOENT = 2
44
44
  _MAX_CLASS_LEVEL = 2 # Max class nesting
45
45
  LIBS = [".", "/lib", "/sd/lib", "/flash/lib", "lib"]
@@ -109,7 +109,7 @@ class Stubber:
109
109
  _errors = []
110
110
  self._log.debug("get attributes {} {}".format(repr(item_instance), item_instance))
111
111
  for name in dir(item_instance):
112
- if name.startswith("_"):
112
+ if name.startswith("_") and not name in self.modules:
113
113
  continue
114
114
  self._log.debug("get attribute {}".format(name))
115
115
  try:
@@ -136,7 +136,8 @@ class Stubber:
136
136
  reset()
137
137
 
138
138
  # remove internal __
139
- _result = sorted([i for i in _result if not (i[0].startswith("_"))], key=lambda x: x[4])
139
+ # _result = sorted([i for i in _result if not (i[0].startswith("_"))], key=lambda x: x[4])
140
+ _result = sorted([i for i in _result if not (i[0].startswith("__"))], key=lambda x: x[4])
140
141
  gc.collect()
141
142
  return _result, _errors
142
143
 
@@ -16,11 +16,11 @@ Y='list'
16
16
  X='tuple'
17
17
  W='micropython'
18
18
  V=repr
19
- T=KeyError
20
- S=IndexError
21
- R=dir
22
- Q=ImportError
23
- P='_'
19
+ T='_'
20
+ S=KeyError
21
+ R=IndexError
22
+ Q=dir
23
+ P=ImportError
24
24
  O='family'
25
25
  N=True
26
26
  M='.'
@@ -38,10 +38,10 @@ C=''
38
38
  import gc as B,sys,uos as os
39
39
  from ujson import dumps as b
40
40
  try:from machine import reset
41
- except Q:pass
41
+ except P:pass
42
42
  try:from collections import OrderedDict as c
43
- except Q:from ucollections import OrderedDict as c
44
- __version__='v1.13.4'
43
+ except P:from ucollections import OrderedDict as c
44
+ __version__='v1.13.8'
45
45
  v=2
46
46
  w=2
47
47
  d=[M,'/lib','/sd/lib','/flash/lib','lib']
@@ -65,21 +65,21 @@ class Stubber:
65
65
  except A:I('error creating stub folder {}'.format(path))
66
66
  C.problematic=['upip','upysh','webrepl_setup','http_client','http_client_ssl','http_server','http_server_ssl'];C.excluded=['webrepl','_webrepl','port_diag','example_sub_led.py','example_pub_button.py'];C.modules=[]
67
67
  def get_obj_attributes(L,item_instance):
68
- I=item_instance;A=[];J=[]
69
- for D in R(I):
70
- if D.startswith(P):continue
68
+ I=item_instance;D=[];J=[]
69
+ for A in Q(I):
70
+ if A.startswith(T)and not A in L.modules:continue
71
71
  try:
72
- E=getattr(I,D)
72
+ E=getattr(I,A)
73
73
  try:F=V(type(E)).split("'")[1]
74
- except S:F=C
74
+ except R:F=C
75
75
  if F in{o,p,q,r,X,Y,Z}:G=1
76
76
  elif F in{s,t}:G=2
77
77
  elif F in'class':G=3
78
78
  else:G=4
79
- A.append((D,V(E),V(type(E)),E,G))
80
- except H as K:J.append("Couldn't get attribute '{}' from object '{}', Err: {}".format(D,I,K))
79
+ D.append((A,V(E),V(type(E)),E,G))
80
+ except H as K:J.append("Couldn't get attribute '{}' from object '{}', Err: {}".format(A,I,K))
81
81
  except k as K:sleep(1);reset()
82
- A=l([A for A in A if not A[0].startswith(P)],key=lambda x:x[4]);B.collect();return A,J
82
+ D=l([A for A in D if not A[0].startswith('__')],key=lambda x:x[4]);B.collect();return D,J
83
83
  def add_modules(A,modules):A.modules=l(set(A.modules)|set(modules))
84
84
  def create_all_stubs(A):
85
85
  B.collect()
@@ -94,27 +94,27 @@ class Stubber:
94
94
  B.collect();return E
95
95
  def create_module_stub(K,module_name,file_name=E):
96
96
  H=file_name;D=module_name
97
- if H is E:L=D.replace(M,P)+'.py';H=K.path+G+L
97
+ if H is E:L=D.replace(M,T)+'.py';H=K.path+G+L
98
98
  else:L=H.split(G)[-1]
99
99
  if G in D:D=D.replace(G,M)
100
100
  O=E
101
- try:O=__import__(D,E,E,'*');S=B.mem_free();I('Stub module: {:<25} to file: {:<70} mem:{:>5}'.format(D,L,S))
102
- except Q:return F
101
+ try:O=__import__(D,E,E,'*');R=B.mem_free();I('Stub module: {:<25} to file: {:<70} mem:{:>5}'.format(D,L,R))
102
+ except P:return F
103
103
  e(H)
104
- with J(H,'w')as R:U='"""\nModule: \'{0}\' on {1}\n"""\n# MCU: {2}\n# Stubber: {3}\n'.format(D,K._fwid,K.info,__version__);R.write(U);R.write('from typing import Any\n\n');K.write_object_stub(R,O,D,C)
104
+ with J(H,'w')as Q:U='"""\nModule: \'{0}\' on {1}\n"""\n# MCU: {2}\n# Stubber: {3}\n'.format(D,K._fwid,K.info,__version__);Q.write(U);Q.write('from typing import Any\n\n');K.write_object_stub(Q,O,D,C)
105
105
  K._report.append('{{"module": "{}", "file": "{}"}}'.format(D,H.replace('\\',G)))
106
106
  if D not in{'os','sys','logging','gc'}:
107
107
  try:del O
108
- except (A,T):pass
108
+ except (A,S):pass
109
109
  try:del sys.modules[D]
110
- except T:pass
110
+ except S:pass
111
111
  B.collect();return N
112
112
  def write_object_stub(M,fp,object_expr,obj_name,indent,in_class=0):
113
113
  d='{0}{1} = {2} # type: {3}\n';c='bound_method';b='Any';Q=in_class;P=object_expr;O='Exception';H=fp;E=indent;B.collect()
114
114
  if P in M.problematic:return
115
115
  R,N=M.get_obj_attributes(P)
116
116
  if N:I(N)
117
- for (F,K,G,S,f) in R:
117
+ for (F,K,G,T,f) in R:
118
118
  if F in['classmethod','staticmethod','BaseException',O]:continue
119
119
  if F[0].isdigit():continue
120
120
  if G=="<class 'type'>"and L(E)<=w*4:
@@ -122,7 +122,7 @@ class Stubber:
122
122
  if V:U=O
123
123
  D='\n{}class {}({}):\n'.format(E,F,U)
124
124
  if V:D+=E+' ...\n';H.write(D);return
125
- H.write(D);M.write_object_stub(H,S,'{0}.{1}'.format(obj_name,F),E+' ',Q+1);D=E+' def __init__(self, *argv, **kwargs) -> None:\n';D+=E+' ...\n\n';H.write(D)
125
+ H.write(D);M.write_object_stub(H,T,'{0}.{1}'.format(obj_name,F),E+' ',Q+1);D=E+' def __init__(self, *argv, **kwargs) -> None:\n';D+=E+' ...\n\n';H.write(D)
126
126
  elif t in G or s in G:
127
127
  W=b;a=C
128
128
  if Q>0:a='self, '
@@ -140,12 +140,12 @@ class Stubber:
140
140
  H.write(D)
141
141
  else:H.write("# all other, type = '{0}'\n".format(G));H.write(E+F+' # type: Any\n')
142
142
  del R;del N
143
- try:del F,K,G,S
144
- except (A,T,m):pass
143
+ try:del F,K,G,T
144
+ except (A,S,m):pass
145
145
  @property
146
146
  def flat_fwid(self):
147
147
  A=self._fwid;B=' .()/\\:$'
148
- for C in B:A=A.replace(C,P)
148
+ for C in B:A=A.replace(C,T)
149
149
  return A
150
150
  def clean(C,path=E):
151
151
  if path is E:path=C.path
@@ -193,8 +193,8 @@ def _info():
193
193
  j='ev3-pybricks';i='pycom';h='pycopy';e='GENERIC';b='arch';a='cpu';Z='ver';V='with';G='mpy';F='build';A=c({O:sys.implementation.name,D:C,F:C,Z:C,n:'stm32'if sys.platform.startswith('pyb')else sys.platform,K:e,a:C,G:C,b:C})
194
194
  try:A[D]=M.join([str(A)for A in sys.implementation.version])
195
195
  except H:pass
196
- try:X=sys.implementation._machine if'_machine'in R(sys.implementation)else os.uname().machine;A[K]=X.strip();A[a]=X.split(V)[1].strip();A[G]=sys.implementation._mpy if'_mpy'in R(sys.implementation)else sys.implementation.mpy if G in R(sys.implementation)else C
197
- except (H,S):pass
196
+ try:X=sys.implementation._machine if'_machine'in Q(sys.implementation)else os.uname().machine;A[K]=X.strip();A[a]=X.split(V)[1].strip();A[G]=sys.implementation._mpy if'_mpy'in Q(sys.implementation)else sys.implementation.mpy if G in Q(sys.implementation)else C
197
+ except (H,R):pass
198
198
  B.collect()
199
199
  for J in [A+'/board_info.csv'for A in d]:
200
200
  if g(J):
@@ -204,19 +204,19 @@ def _info():
204
204
  I=I.split(V)[0].strip()
205
205
  if f(A,I,J):break
206
206
  A[K]=e
207
- A[K]=A[K].replace(' ',P);B.collect()
207
+ A[K]=A[K].replace(' ',T);B.collect()
208
208
  try:
209
209
  A[F]=U(os.uname()[3])
210
210
  if not A[F]:A[F]=U(os.uname()[2])
211
211
  if not A[F]and';'in sys.version:A[F]=U(sys.version.split(';')[1])
212
- except (H,S):pass
212
+ except (H,R):pass
213
213
  if A[F]and L(A[F])>5:A[F]=C
214
214
  if A[D]==C and sys.platform not in('unix','win32'):
215
215
  try:k=os.uname();A[D]=k.release
216
- except (S,H,TypeError):pass
216
+ except (R,H,TypeError):pass
217
217
  for (l,m,o) in [(h,h,'const'),(i,i,'FAT'),(j,'pybricks.hubs','EV3Brick')]:
218
218
  try:p=__import__(m,E,E,o);A[O]=l;del p;break
219
- except (Q,T):pass
219
+ except (P,S):pass
220
220
  if A[O]==j:A['release']='2.0.0'
221
221
  if A[O]==W:
222
222
  if A[D]and A[D].endswith('.0')and A[D]>='1.10.0'and A[D]<='1.19.9':A[D]=A[D][:-2]