micropython-stubber 1.14.1__py3-none-any.whl → 1.15.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- micropython_stubber-1.15.1.dist-info/METADATA +244 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/RECORD +49 -46
- stubber/__init__.py +1 -1
- stubber/basicgit.py +27 -14
- stubber/board/createstubs.py +34 -36
- stubber/board/createstubs_db.py +35 -35
- stubber/board/createstubs_db_min.py +195 -193
- stubber/board/createstubs_db_mpy.mpy +0 -0
- stubber/board/createstubs_info.py +73 -42
- stubber/board/createstubs_lvgl.py +35 -35
- stubber/board/createstubs_lvgl_min.py +88 -87
- stubber/board/createstubs_lvgl_mpy.mpy +0 -0
- stubber/board/createstubs_mem.py +44 -40
- stubber/board/createstubs_mem_min.py +179 -174
- stubber/board/createstubs_mem_mpy.mpy +0 -0
- stubber/board/createstubs_min.py +75 -74
- stubber/board/createstubs_mpy.mpy +0 -0
- stubber/board/info.py +183 -0
- stubber/codemod/enrich.py +28 -16
- stubber/commands/build_cmd.py +3 -3
- stubber/commands/get_core_cmd.py +17 -5
- stubber/commands/get_docstubs_cmd.py +23 -8
- stubber/commands/get_frozen_cmd.py +62 -9
- stubber/commands/get_lobo_cmd.py +13 -3
- stubber/commands/merge_cmd.py +7 -4
- stubber/commands/publish_cmd.py +5 -4
- stubber/commands/stub_cmd.py +2 -1
- stubber/commands/variants_cmd.py +0 -1
- stubber/freeze/common.py +2 -2
- stubber/freeze/freeze_folder.py +1 -1
- stubber/freeze/get_frozen.py +1 -1
- stubber/minify.py +43 -28
- stubber/publish/bump.py +1 -1
- stubber/publish/candidates.py +61 -17
- stubber/publish/defaults.py +44 -0
- stubber/publish/merge_docstubs.py +19 -56
- stubber/publish/package.py +44 -37
- stubber/publish/pathnames.py +51 -0
- stubber/publish/publish.py +5 -4
- stubber/publish/stubpacker.py +55 -33
- stubber/rst/lookup.py +7 -16
- stubber/rst/reader.py +39 -8
- stubber/stubs_from_docs.py +5 -8
- stubber/utils/post.py +34 -40
- stubber/utils/repos.py +32 -17
- stubber/utils/stubmaker.py +22 -14
- micropython_stubber-1.14.1.dist-info/METADATA +0 -217
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/LICENSE +0 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/WHEEL +0 -0
- {micropython_stubber-1.14.1.dist-info → micropython_stubber-1.15.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,244 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: micropython-stubber
|
3
|
+
Version: 1.15.1
|
4
|
+
Summary: Tooling to create and maintain stubs for MicroPython
|
5
|
+
Home-page: https://github.com/Josverl/micropython-stubber#readme
|
6
|
+
License: MIT
|
7
|
+
Keywords: MicroPython,stubs,vscode,pyright,linting,static type check
|
8
|
+
Author: Jos Verlinde
|
9
|
+
Author-email: jos_verlinde@hotmail.com
|
10
|
+
Requires-Python: >=3.9,<3.12
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
16
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
17
|
+
Classifier: Programming Language :: Python :: Implementation :: MicroPython
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
19
|
+
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
|
20
|
+
Provides-Extra: tools
|
21
|
+
Requires-Dist: autoflake (>=1.7,<3.0)
|
22
|
+
Requires-Dist: black (>=22.10,<23.0)
|
23
|
+
Requires-Dist: cachetools (>=5.3.0,<6.0.0)
|
24
|
+
Requires-Dist: click (>=8.1.3,<9.0.0)
|
25
|
+
Requires-Dist: esptool (>=4.4,<5.0) ; extra == "tools"
|
26
|
+
Requires-Dist: executing (>=2.0.1,<3.0.0)
|
27
|
+
Requires-Dist: importlib-metadata (>=1.0,<2.0) ; python_version < "3.8"
|
28
|
+
Requires-Dist: libcst (>=0.4.9,<1.2.0)
|
29
|
+
Requires-Dist: loguru (>=0.6,<0.8)
|
30
|
+
Requires-Dist: mypy (==1.7.0)
|
31
|
+
Requires-Dist: packaging (>=21.3,<24.0)
|
32
|
+
Requires-Dist: pipx (>=1.1.0,<2.0.0)
|
33
|
+
Requires-Dist: pygithub (>=2.1.1,<3.0.0)
|
34
|
+
Requires-Dist: pypi-simple (>=1.0.0,<2.0.0)
|
35
|
+
Requires-Dist: pyright (>=1.1.265,<2.0.0)
|
36
|
+
Requires-Dist: pyserial (>=3.5,<4.0)
|
37
|
+
Requires-Dist: pysondb-v2 (>=2.1.0,<3.0.0)
|
38
|
+
Requires-Dist: python-minifier (>=2.7.0,<3.0.0)
|
39
|
+
Requires-Dist: requests (>=2.28.0,<3.0.0)
|
40
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
41
|
+
Requires-Dist: tenacity (>=8.2.2,<9.0.0)
|
42
|
+
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
43
|
+
Requires-Dist: tomli-w (>=1.0.0,<2.0.0)
|
44
|
+
Requires-Dist: typed-config (>=1.3.0,<2.0.0)
|
45
|
+
Project-URL: Documentation, https://micropython-stubber.readthedocs.io/
|
46
|
+
Project-URL: Repository, https://github.com/Josverl/micropython-stubber
|
47
|
+
Description-Content-Type: text/markdown
|
48
|
+
|
49
|
+
# Boost MicroPython productivity in VSCode
|
50
|
+
|
51
|
+
[](https://pypi.org/project/micropython-stubber/)
|
52
|
+
[](https://badgen.net/pypi/python/micropython-stubber)
|
53
|
+
[](https://micropython-stubber.readthedocs.io/en/latest/?badge=latest "Document build status badge")
|
54
|
+
[](https://github.com/josverl/micropython-stubber/stargazers)
|
55
|
+
[](#Contributions)
|
56
|
+
<!-- break -->
|
57
|
+
[](https://github.com/Josverl/micropython-stubber/actions/workflows/pytest.yml)
|
58
|
+
[](https://codecov.io/gh/Josverl/micropython-stubber)
|
59
|
+
[](https://github.com/python/black "Black badge")
|
60
|
+
<!-- break -->
|
61
|
+
[](https://open.vscode.dev/josverl/micropython-stubber)
|
63
|
+
|
64
|
+
The intellisense and code linting that is so prevalent in modern editors, does not work out-of-the-gate for MicroPython projects.
|
65
|
+
While 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.
|
66
|
+
|
67
|
+
Writing 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.
|
68
|
+
|
69
|
+
Fortunately 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.
|
70
|
+
|
71
|
+
|
72
|
+
![demo][]]
|
73
|
+
|
74
|
+
In order to achieve this a few things are needed:
|
75
|
+
1) Stub files for the native / enabled modules in the firmware using PEP 484 Type Hints
|
76
|
+
2) Specific configuration of the VSCode Python extensions
|
77
|
+
3) Specific configuration of Pylint [ Optional ]
|
78
|
+
4) Suppression of warnings that collide with the MicroPython principals or code optimization.
|
79
|
+
|
80
|
+
Please review the documentation on [https://micropython-stubber.readthedocs.io]
|
81
|
+
|
82
|
+
With 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.
|
83
|
+
|
84
|
+
Note that the above is not limited to VSCode and pylint, but it happens to be the combination that I use.
|
85
|
+
|
86
|
+
A lot of subs have already been generated and are shared on PyPi, github or pre-installed by a tool, so it is quite likely that you can just grab a copy be be productive in a few minutes.
|
87
|
+
|
88
|
+
## To install the stubs from PyPI
|
89
|
+
This section describes how to install the stubs from PyPI, and how to use them in your project.
|
90
|
+
If you want to create or maintain stub - please see the next section.
|
91
|
+
|
92
|
+
- Install in a typings folder (recommended)
|
93
|
+
`pip install -U micropython-<port>[-<board>]stubs --no-user --target ./typings`
|
94
|
+
- Install in a venv (after activating)
|
95
|
+
`pip install -U micropython-<port>[-<board>]stubs --no-user`
|
96
|
+
|
97
|
+
Examples:
|
98
|
+
``` bash
|
99
|
+
pip install -U micropython-stm32-stubs
|
100
|
+
|
101
|
+
# Install stubs for a specific version.
|
102
|
+
pip install -U micropython-esp32-stubs==1.20.0.*
|
103
|
+
|
104
|
+
# Install stubs for a specific board.
|
105
|
+
pip install -U micropython-rp2-pico_w-stubs
|
106
|
+
```
|
107
|
+
|
108
|
+
For more details how to use the stubs please refer to [the documentation on RTD](https://micropython-stubs.readthedocs.io/en/latest/20_using.html)
|
109
|
+
|
110
|
+
|
111
|
+
1. 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.
|
112
|
+
That repo also contains examples configuration files that can be easily adopted to your setup.
|
113
|
+
|
114
|
+
2. 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.
|
115
|
+
You should use micropy-cli to consume stubs from that repo.
|
116
|
+
|
117
|
+
The (stretch) goal is to create a VSCode add-in to simplify the configuration, and allow easy switching between different firmwares and versions.
|
118
|
+
|
119
|
+
|
120
|
+
## Install and basic usage of the stubber tool
|
121
|
+
|
122
|
+
``` bash
|
123
|
+
pip install micropython-stubber
|
124
|
+
|
125
|
+
# go to your working folder
|
126
|
+
cd my_stub_folder
|
127
|
+
mkdir all-stubs
|
128
|
+
|
129
|
+
# clone the micropython repo's and switch to a specific version
|
130
|
+
stubber clone
|
131
|
+
stubber switch --version v1.18
|
132
|
+
|
133
|
+
# get the document stubs for the current version ( v1.18 )
|
134
|
+
stubber get-docstubs
|
135
|
+
|
136
|
+
# get the frozen stubs for the current version ( v1.18 )
|
137
|
+
stubber get-frozen
|
138
|
+
|
139
|
+
# get the core CPython compatibility stubs from PyPi
|
140
|
+
stubber get-core
|
141
|
+
|
142
|
+
# Update the fallback stubs
|
143
|
+
stubber update-fallback
|
144
|
+
|
145
|
+
#
|
146
|
+
ls all-stubs
|
147
|
+
dir all-stubs
|
148
|
+
```
|
149
|
+
|
150
|
+
|
151
|
+
## Developing & testing
|
152
|
+
|
153
|
+
This is described in more detail in the [developing](docs/developing.md) and [testing](docs/testing.md) documents in the docs folder.
|
154
|
+
|
155
|
+
## Branch Main
|
156
|
+
The name of the default branch has been changed to `main`.
|
157
|
+
If you have cloned this repo before you main need to adjust the local repro to be aware of this, or create a fresh clone.
|
158
|
+
|
159
|
+
To update run the below command:
|
160
|
+
``` bash
|
161
|
+
git branch -m master main
|
162
|
+
git fetch origin
|
163
|
+
git branch -u origin/main main
|
164
|
+
git remote set-head origin -a
|
165
|
+
```
|
166
|
+
|
167
|
+
for 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)
|
168
|
+
|
169
|
+
## Licensing
|
170
|
+
|
171
|
+
MicroPython-Stubber is licensed under the MIT license, and all contributions should follow this [LICENSE](LICENSE).
|
172
|
+
|
173
|
+
|
174
|
+
# Contributions
|
175
|
+
<!-- spell-checker: disable -->
|
176
|
+
|
177
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
178
|
+
<!-- prettier-ignore-start -->
|
179
|
+
<!-- markdownlint-disable -->
|
180
|
+
<table>
|
181
|
+
<tbody>
|
182
|
+
<tr>
|
183
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Josverl"><img src="https://avatars2.githubusercontent.com/u/981654?v=4?s=100" width="100px;" alt="Jos Verlinde"/><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>
|
184
|
+
<td align="center" valign="top" width="14.28%"><a href="https://thonny.org/"><img src="https://avatars1.githubusercontent.com/u/46202078?v=4?s=100" width="100px;" alt="Thonny, Python IDE for beginners"/><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>
|
185
|
+
<td align="center" valign="top" width="14.28%"><a href="https://micropython.org/"><img src="https://avatars1.githubusercontent.com/u/6298560?v=4?s=100" width="100px;" alt="MicroPython"/><br /><sub><b>MicroPython</b></sub></a><br /><a href="#data-micropython" title="Data">🔣</a> <a href="#stubs-micropython" title="MicroPython stubs">📚</a></td>
|
186
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/microsoft/pyright"><img src="https://avatars.githubusercontent.com/u/6154722?v=4?s=100" width="100px;" alt="pyright"/><br /><sub><b>pyright</b></sub></a><br /><a href="#tool-pyright" title="Tools">🔧</a></td>
|
187
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/loboris"><img src="https://avatars3.githubusercontent.com/u/6280349?v=4?s=100" width="100px;" alt="Boris Lovosevic"/><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>
|
188
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pfalcon"><img src="https://avatars3.githubusercontent.com/u/500451?v=4?s=100" width="100px;" alt="Paul Sokolovsky"/><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>
|
189
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pycopy"><img src="https://avatars0.githubusercontent.com/u/67273174?v=4?s=100" width="100px;" alt="pycopy"/><br /><sub><b>pycopy</b></sub></a><br /><a href="#data-pycopy" title="Data">🔣</a> <a href="#stubs-pycopy" title="MicroPython stubs">📚</a></td>
|
190
|
+
</tr>
|
191
|
+
<tr>
|
192
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pycom"><img src="https://avatars2.githubusercontent.com/u/16415153?v=4?s=100" width="100px;" alt="Pycom"/><br /><sub><b>Pycom</b></sub></a><br /><a href="#infra-pycom" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
193
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/BradenM"><img src="https://avatars1.githubusercontent.com/u/5913808?v=4?s=100" width="100px;" alt="Braden Mars"/><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>
|
194
|
+
<td align="center" valign="top" width="14.28%"><a href="https://binary.com.au/"><img src="https://avatars2.githubusercontent.com/u/175909?v=4?s=100" width="100px;" alt="James Manners"/><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>
|
195
|
+
<td align="center" valign="top" width="14.28%"><a href="http://patrickwalters.us/"><img src="https://avatars0.githubusercontent.com/u/4002194?v=4?s=100" width="100px;" alt="Patrick"/><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>
|
196
|
+
<td align="center" valign="top" width="14.28%"><a href="https://opencollective.com/pythonseverywhere"><img src="https://avatars3.githubusercontent.com/u/16009100?v=4?s=100" width="100px;" alt="Paul m. p. P."/><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>
|
197
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/edreamleo"><img src="https://avatars0.githubusercontent.com/u/592928?v=4?s=100" width="100px;" alt="Edward K. Ream"/><br /><sub><b>Edward K. Ream</b></sub></a><br /><a href="#plugin-edreamleo" title="Plugin/utility libraries">🔌</a></td>
|
198
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dastultz"><img src="https://avatars3.githubusercontent.com/u/4334042?v=4?s=100" width="100px;" alt="Daryl Stultz"/><br /><sub><b>Daryl Stultz</b></sub></a><br /><a href="#stubs-dastultz" title="MicroPython stubs">📚</a></td>
|
199
|
+
</tr>
|
200
|
+
<tr>
|
201
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cabletie"><img src="https://avatars1.githubusercontent.com/u/2356734?v=4?s=100" width="100px;" alt="Keeping things together"/><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>
|
202
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vbolshakov"><img src="https://avatars2.githubusercontent.com/u/2453324?v=4?s=100" width="100px;" alt="vbolshakov"/><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>
|
203
|
+
<td align="center" valign="top" width="14.28%"><a href="https://lemariva.com/"><img src="https://avatars2.githubusercontent.com/u/15173329?v=4?s=100" width="100px;" alt="Mauro Riva"/><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>
|
204
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MathijsNL"><img src="https://avatars0.githubusercontent.com/u/1612886?v=4?s=100" width="100px;" alt="MathijsNL"/><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>
|
205
|
+
<td align="center" valign="top" width="14.28%"><a href="http://comingsoon.tm/"><img src="https://avatars0.githubusercontent.com/u/13251689?v=4?s=100" width="100px;" alt="Callum Jacob Hays"/><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>
|
206
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/v923z"><img src="https://avatars0.githubusercontent.com/u/1310472?v=4?s=100" width="100px;" alt="Zoltán Vörös"/><br /><sub><b>Zoltán Vörös</b></sub></a><br /><a href="#data-v923z" title="Data">🔣</a></td>
|
207
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vincent-l-j"><img src="https://avatars.githubusercontent.com/u/20021376?v=4?s=100" width="100px;" alt="vincent-l-j"/><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>
|
208
|
+
</tr>
|
209
|
+
<tr>
|
210
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yegorLitvinov"><img src="https://avatars.githubusercontent.com/u/20367310?v=4?s=100" width="100px;" alt="Egor Litvinov"/><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>
|
211
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/samskiter"><img src="https://avatars.githubusercontent.com/u/1271643?v=4?s=100" width="100px;" alt="Sam Duke"/><br /><sub><b>Sam Duke</b></sub></a><br /><a href="https://github.com/Josverl/micropython-stubber/commits?author=samskiter" title="Code">💻</a></td>
|
212
|
+
</tr>
|
213
|
+
</tbody>
|
214
|
+
</table>
|
215
|
+
|
216
|
+
<!-- markdownlint-restore -->
|
217
|
+
<!-- prettier-ignore-end -->
|
218
|
+
|
219
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
220
|
+
|
221
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
222
|
+
|
223
|
+
----------------------------
|
224
|
+
|
225
|
+
--------------------------------
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
[stubs-repo]: https://github.com/Josverl/micropython-stubs
|
230
|
+
[stubs-repo2]: https://github.com/BradenM/micropy-stubs
|
231
|
+
[micropython-stubber]: https://github.com/Josverl/micropython-stubber
|
232
|
+
[micropython-stubs]: https://github.com/Josverl/micropython-stubs#micropython-stubs
|
233
|
+
[micropy-cli]: https://github.com/BradenM/micropy-cli
|
234
|
+
[using-the-stubs]: https://github.com/Josverl/micropython-stubs#using-the-stubs
|
235
|
+
[demo]: https://github.com/Josverl/micropython-stubber/blob/main/docs/img/demo.gif?raw=true "demo of writing code using the stubs"
|
236
|
+
[stub processing order]: https://github.com/Josverl/micropython-stubber/blob/main/docs/img/stuborder_pylance.png?raw=true "recommended stub processing order"
|
237
|
+
[naming-convention]: #naming-convention-and-stub-folder-structure
|
238
|
+
[all-stubs]: https://github.com/Josverl/micropython-stubs/blob/main/firmwares.md
|
239
|
+
[micropython]: https://github.com/micropython/micropython
|
240
|
+
[micropython-lib]: https://github.com/micropython/micropython-lib
|
241
|
+
[pycopy]: https://github.com/pfalcon/pycopy
|
242
|
+
[pycopy-lib]: https://github.com/pfalcon/pycopy-lib
|
243
|
+
|
244
|
+
|
@@ -1,20 +1,21 @@
|
|
1
|
-
stubber/__init__.py,sha256=
|
2
|
-
stubber/basicgit.py,sha256=
|
1
|
+
stubber/__init__.py,sha256=7AzDjHjHOU4qlF4FalwV28Ino4VUpEqY3T0n1Unil80,51
|
2
|
+
stubber/basicgit.py,sha256=2QbI0dNBO-Vr7zkSh8x7SLaje5voP79-UfRq7QdqirM,9606
|
3
3
|
stubber/board/board_info.csv,sha256=e3xY-VTOh-iOmpGhhuADXnk3Rq-17ID0PJr8eKSH5Fw,7040
|
4
4
|
stubber/board/boot.py,sha256=XjWlKErU5nI1HJSugXIP_3hlwgRQboE6sJrpcbSygnk,1120
|
5
|
-
stubber/board/createstubs.py,sha256=
|
6
|
-
stubber/board/createstubs_db.py,sha256=
|
7
|
-
stubber/board/createstubs_db_min.py,sha256=
|
8
|
-
stubber/board/createstubs_db_mpy.mpy,sha256=
|
9
|
-
stubber/board/createstubs_info.py,sha256=
|
10
|
-
stubber/board/createstubs_lvgl.py,sha256=
|
11
|
-
stubber/board/createstubs_lvgl_min.py,sha256=
|
12
|
-
stubber/board/createstubs_lvgl_mpy.mpy,sha256=
|
13
|
-
stubber/board/createstubs_mem.py,sha256=
|
14
|
-
stubber/board/createstubs_mem_min.py,sha256=
|
15
|
-
stubber/board/createstubs_mem_mpy.mpy,sha256=
|
16
|
-
stubber/board/createstubs_min.py,sha256=
|
17
|
-
stubber/board/createstubs_mpy.mpy,sha256=
|
5
|
+
stubber/board/createstubs.py,sha256=PF-ZQFmP44o8aF0zOhZrs8-zYZjzYODKwtXCRJ0T_48,30800
|
6
|
+
stubber/board/createstubs_db.py,sha256=v4zXCshMtLTIyv4StBh_aiwxvOG9N5-n39wnokRH_3o,28342
|
7
|
+
stubber/board/createstubs_db_min.py,sha256=OTnbMdx3Uo8sTXieCNsasC3CLZZYCNIDabY8Ulcj920,10498
|
8
|
+
stubber/board/createstubs_db_mpy.mpy,sha256=gdzT7ugmmCqApAohu40dZ2bxm-4Zw73x-Fpg-9maf7Y,8638
|
9
|
+
stubber/board/createstubs_info.py,sha256=TMq_nbJyQorlUrf2fRvQhQk1pfgk1rsMYVzYvRq-g7I,30804
|
10
|
+
stubber/board/createstubs_lvgl.py,sha256=6dPScUZzpauK2nU7gdrS55tN-sJiNStZjH1tU_4wvDc,25551
|
11
|
+
stubber/board/createstubs_lvgl_min.py,sha256=sVIGo6pqHLeMYOizcVaywPLVLweKOf6M6dWCFKwEeHE,9748
|
12
|
+
stubber/board/createstubs_lvgl_mpy.mpy,sha256=IGNxkP8UMhLdFIU3Sztjjsf51HCXIsJX43Ry8EmKo0w,8064
|
13
|
+
stubber/board/createstubs_mem.py,sha256=IOZetXX0syoCOKj9ny-REfp49Eam_9INP6l5nYS9XbQ,26451
|
14
|
+
stubber/board/createstubs_mem_min.py,sha256=Niirax4b2QhBNEc0Cy1tpormAKHz1l2FPIsuBpj4LwI,9866
|
15
|
+
stubber/board/createstubs_mem_mpy.mpy,sha256=aLLFmM2wx4sRhBdbf8XIQLdIvuE4ZsAaFEAO2phY-N4,8078
|
16
|
+
stubber/board/createstubs_min.py,sha256=gOnDmHhOnwZ9e9_SgMkvOm7hHeF6zLoGMWjin4xWAUw,12131
|
17
|
+
stubber/board/createstubs_mpy.mpy,sha256=6mR2Tan_N-EXNVHf5FjGV4rQ0jo6Y0EIebSRS5tiDzs,10886
|
18
|
+
stubber/board/info.py,sha256=b7SOPZHVsVhaayKCwVkFZlYu0BW-UFI7LuG1Eop9480,5629
|
18
19
|
stubber/board/logging.py,sha256=rdneoAwZg84uiWBJWYIp0gMcT2oU9Lu-1WIu1LqT_9w,2218
|
19
20
|
stubber/board/main.py,sha256=f6V3tdt6sPZVLuwemT-NLuK9GySfW2c2J6PJMOOWQQw,413
|
20
21
|
stubber/board/modulelist.txt,sha256=-LaSa5Qk3IVFecAm9cs_GBXLOO2O-Fx_SIvMCOzS13Y,2717
|
@@ -27,28 +28,28 @@ stubber/codemod/_partials/modules_reader.py,sha256=xZg6j9OMrh0skUPi-aul_XexIh_K9
|
|
27
28
|
stubber/codemod/add_comment.py,sha256=CZMjtKO9aarZo1E60QXo80CLJAH05z_ylK6Vvjvb0ls,1965
|
28
29
|
stubber/codemod/add_method.py,sha256=SSGgblIRCxo_m6uhkI1-DnVcCJYo2bhnhuWkOObbROU,2611
|
29
30
|
stubber/codemod/board.py,sha256=ldtkBa9vhnh-P1y8uIv1I_uu8PXNQp5xd8Dmx023WlQ,11790
|
30
|
-
stubber/codemod/enrich.py,sha256=
|
31
|
+
stubber/codemod/enrich.py,sha256=8aIpfvMwAqtocQHN2JLtZvGHMBAkqJsFaooLTgycPJ0,4885
|
31
32
|
stubber/codemod/merge_docstub.py,sha256=7natmtzStdgFKDMJjHk_L5I4XBVbFM4MyxB6IG47ncg,8894
|
32
33
|
stubber/codemod/modify_list.py,sha256=xrpFBKug273D9E02owUheZD418BvsIHIZCFj4YDjTxU,2118
|
33
34
|
stubber/codemod/utils.py,sha256=itARwbMps9UlzMaf4F3wJLJXJvtD-HYq1T1xw96zmR8,2459
|
34
35
|
stubber/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
35
|
-
stubber/commands/build_cmd.py,sha256=
|
36
|
+
stubber/commands/build_cmd.py,sha256=br1Cdnc3fqZGvWBRgQPkS-ukmRBHVZR4WfEAHrgxBp0,2203
|
36
37
|
stubber/commands/cli.py,sha256=pHtViupghgqKMxbyk5_Zz-qHx6i-BGdnTqRO-kngH2E,1850
|
37
38
|
stubber/commands/clone_cmd.py,sha256=Yutrkmt0FYF5XY2XFIbA7iUkFkT6FypDSLby790PMn0,2646
|
38
39
|
stubber/commands/config_cmd.py,sha256=Rmus8FoWtq9_3r6PC2r1rxuY54tar8-MeLiR_kUPkc0,920
|
39
40
|
stubber/commands/enrich_folder_cmd.py,sha256=S0yzn0pLK30WhBUBHqQPXl24kISYoDIdMgDLqnps4V8,1528
|
40
|
-
stubber/commands/get_core_cmd.py,sha256=
|
41
|
-
stubber/commands/get_docstubs_cmd.py,sha256=
|
42
|
-
stubber/commands/get_frozen_cmd.py,sha256=
|
43
|
-
stubber/commands/get_lobo_cmd.py,sha256=
|
44
|
-
stubber/commands/merge_cmd.py,sha256=
|
41
|
+
stubber/commands/get_core_cmd.py,sha256=oxiDb_r1Ao9N2maeV0EBKosI4nRDNJkDk52xNunYICM,2226
|
42
|
+
stubber/commands/get_docstubs_cmd.py,sha256=elBVClk_Ndq0tmeYpVqbSbHtHd-Uoo58wlUfW22q1pU,2918
|
43
|
+
stubber/commands/get_frozen_cmd.py,sha256=sOlnje2DDQ6YW27ePDya17S7gAZ9IoAFcnHKSbpEj4o,3971
|
44
|
+
stubber/commands/get_lobo_cmd.py,sha256=ss-MEeaDAAqQhBsvnSPjhQVd9adeJpe-EVR-Xt9iWjU,1516
|
45
|
+
stubber/commands/merge_cmd.py,sha256=2gQYxqapVGD8WMBsqRES7xjIS8acu4hTyutr1OANpAo,1673
|
45
46
|
stubber/commands/minify_cmd.py,sha256=PFFTezbPaXZ9vugQJ-s3zzbIuVm-PpFqDAPriKVTKgw,2272
|
46
|
-
stubber/commands/publish_cmd.py,sha256=
|
47
|
-
stubber/commands/stub_cmd.py,sha256=
|
47
|
+
stubber/commands/publish_cmd.py,sha256=0dGTKTcUWeBVQUTD1j78Mtga8c4lC9WvXBlUa6Y-cu0,2715
|
48
|
+
stubber/commands/stub_cmd.py,sha256=St3UlrVdbkddXystDG2NmKLq_1RbE-gNxlE7ShwQwaw,1186
|
48
49
|
stubber/commands/switch_cmd.py,sha256=QsOgIzY8XOjmYTBtTdh7gC7wFeSBFO7vPL4N7AxTr_0,1678
|
49
50
|
stubber/commands/upd_fallback_cmd.py,sha256=5d6lIFa1mTo-2O-gDZKwHOZAo5bvX5mp4iaTIfBSaQc,1056
|
50
51
|
stubber/commands/upd_module_list_cmd.py,sha256=drtjqS2aMd0aM-JJdnyl4jcnbq135lfSVcgK_6eovBk,499
|
51
|
-
stubber/commands/variants_cmd.py,sha256=
|
52
|
+
stubber/commands/variants_cmd.py,sha256=QDm-KtDFIa9_Jl21vjArrW7OrToR8VfwK22pRo0e6CE,1284
|
52
53
|
stubber/cst_transformer.py,sha256=57ILkYBYWKQmq9Iz2VuP5_L4oksC9ofQVV4Gw-3veqU,6367
|
53
54
|
stubber/data/board_info.csv,sha256=d64tfwmgkS491hgB4YN9kap7Tu7Hs4oUXxd-mHnXGyY,7120
|
54
55
|
stubber/data/board_info.json,sha256=7wwkNESVm_nSKwGIutS9nWPRdIkamGtXhivgF4ZNRLk,46684
|
@@ -57,33 +58,35 @@ stubber/data/requirements-core-micropython.txt,sha256=6RQWWbLh8YVcD_l1-hjg6wX_Fm
|
|
57
58
|
stubber/data/requirements-core-pycopy.txt,sha256=tW71l6FIuoQY1tuxkDgeN4Uw8IIp0YrlhhaaqSGSOA8,1051
|
58
59
|
stubber/downloader.py,sha256=UbrvPg8xaX5xcdAaFUe2pdDBor5clyTl3yzh7r7FLdc,1206
|
59
60
|
stubber/freeze/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60
|
-
stubber/freeze/common.py,sha256=
|
61
|
-
stubber/freeze/freeze_folder.py,sha256=
|
61
|
+
stubber/freeze/common.py,sha256=fydpiBQvwwBM-Uib12NG1k51Pm5gUmPa19UFj6ZTD5E,2639
|
62
|
+
stubber/freeze/freeze_folder.py,sha256=9jLa6M1Uie6MOBnXezrrBYkM9sq4Ja6bz7RGsFpIZJw,2491
|
62
63
|
stubber/freeze/freeze_manifest_2.py,sha256=Vdrs2A5vvDDZ4WamcHG9sleKqNYGwIJ5yNQXpPlTb7E,4020
|
63
|
-
stubber/freeze/get_frozen.py,sha256=
|
64
|
+
stubber/freeze/get_frozen.py,sha256=a7df4ltuYgw1A_Zu2tyQFZaWNZjWrWG9xDAgK1resso,4936
|
64
65
|
stubber/get_cpython.py,sha256=RYL3HHbNjaapT0JQZaLVd8wLSfm6RB6XpVELOae1z98,3782
|
65
66
|
stubber/get_lobo.py,sha256=jyysWbeEwNuZZtkTudJP1QbyVvh-TwFom5cE7iCi9lE,1776
|
66
|
-
stubber/minify.py,sha256=
|
67
|
+
stubber/minify.py,sha256=fN8vmIvDXm8DaKbcApK8A7oJGXoUVyUc8YbGDrq7kPg,14002
|
67
68
|
stubber/publish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
68
|
-
stubber/publish/bump.py,sha256=
|
69
|
-
stubber/publish/candidates.py,sha256=
|
69
|
+
stubber/publish/bump.py,sha256=qSb1DpaIxgyoH3YcPU1XKyDKgqkomxSm0WWf1sAVh0Y,3262
|
70
|
+
stubber/publish/candidates.py,sha256=FUrFyPex6pe3_ISH6Sp3ZYrC4DYZCPjaM7hXaA6Uidg,11463
|
70
71
|
stubber/publish/database.py,sha256=CLy5oiLasA-YzTTXi9d01qLAyk7NpugCDUOa5R9Ac2g,623
|
72
|
+
stubber/publish/defaults.py,sha256=hSP4rahJ3JqQ0G_shS3JfxWfEyxUFVrhvzagwxtqFZ4,1622
|
71
73
|
stubber/publish/enums.py,sha256=YI_0q3Iz3v1YqDuHgbuj7x6FBS5y5w3G1UdgpCGunNs,954
|
72
|
-
stubber/publish/merge_docstubs.py,sha256=
|
74
|
+
stubber/publish/merge_docstubs.py,sha256=XBX6-UzneCQRaYuahwLkfEgySwuxzRlYzlsevOFxgoo,5371
|
73
75
|
stubber/publish/missing_class_methods.py,sha256=8i4Znit5vOaGjuXlFn_BYBIEt7G45i0l0gbj1hWKgb8,1771
|
74
|
-
stubber/publish/package.py,sha256=
|
75
|
-
stubber/publish/
|
76
|
+
stubber/publish/package.py,sha256=ZXIHDXKxzYZpCzT-g2xSxS0hB7PGyPsmXKfNXgxYZTw,6332
|
77
|
+
stubber/publish/pathnames.py,sha256=04zlFoRUcvTV7qVyc9z8mq2QdnGB82duclcCfTivO-0,1807
|
78
|
+
stubber/publish/publish.py,sha256=9Lce_NjTySwM92-eiXgXcfBGT4q0-PvBySKumtzgOKA,3569
|
76
79
|
stubber/publish/pypi.py,sha256=Mu1F7Xx4e0NPWK1_Erck6QGEfdY8w67EBeWFi6JiAzk,1240
|
77
|
-
stubber/publish/stubpacker.py,sha256=
|
80
|
+
stubber/publish/stubpacker.py,sha256=Vqsio0ihUDQcvoLV3OmKaXnxjGkGoHf-F5UEB-4pr54,36385
|
78
81
|
stubber/rst/__init__.py,sha256=5VcbDCotIICa2xnJDs_gw2sFXpjjGOZZbwCrNKXy1OE,293
|
79
82
|
stubber/rst/classsort.py,sha256=YCmF4QEYXqZ1Yu2FZb1iPQBrVkq-mrZaBaRcSUlC7ZE,2655
|
80
|
-
stubber/rst/lookup.py,sha256=
|
83
|
+
stubber/rst/lookup.py,sha256=gXaqgoXT9rkPEl9DDIDOKOEi0U4jW4CV8aaMAIyMGvI,19856
|
81
84
|
stubber/rst/output_dict.py,sha256=cpBXRtUD-uh0EgjWIBiRrMLBmIAEXjoJFSOAg-qJQiU,14755
|
82
|
-
stubber/rst/reader.py,sha256=
|
85
|
+
stubber/rst/reader.py,sha256=uR0MW6oFrxD5zJS9J4-wevUmcUHOPG6nhHifI9kkuIs,33336
|
83
86
|
stubber/rst/report_return.py,sha256=WZJSbgjsjxFeCeY-vLms56gv_x3TubaGXGQ8--d8RqI,2814
|
84
87
|
stubber/rst/rst_utils.py,sha256=q4MCmhCeI0fnx6KNVdgz1nE4_hAK4T-F7oAMBnmwZ4w,17817
|
85
88
|
stubber/stubber.py,sha256=fPMqCT68AY8UEe2njlnbAU9vK87ZF3i7OAIJNCONsZY,1957
|
86
|
-
stubber/stubs_from_docs.py,sha256=
|
89
|
+
stubber/stubs_from_docs.py,sha256=PXuHQWvhxMA11qrLgd-myitqf0jixIsord1u2hgmTI4,2885
|
87
90
|
stubber/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
88
91
|
stubber/tools/manifestfile.py,sha256=O8jYChw8wJyIeUb5NOoC5wbgH2zUMSCff3-KvQKGv8M,23715
|
89
92
|
stubber/tools/readme.md,sha256=kH7dA2Rs4BLCXa2ILoTDIj3sJHcGYtDPntyxVIOXvtI,199
|
@@ -93,14 +96,14 @@ stubber/utils/__init__.py,sha256=tAmo9fjxIkMsmH4ZkgNB05zODEO_WjHDLXZFKk3SS3U,205
|
|
93
96
|
stubber/utils/config.py,sha256=H-QDGtjB90ezAU0Avfu5QBe65ANXvVcId03tnFv4Viw,4865
|
94
97
|
stubber/utils/makeversionhdr.py,sha256=ZRpClirIzNK4saZHPaDuEpXhBRI_Ow_yZOxeNM3D_Ro,1908
|
95
98
|
stubber/utils/manifest.py,sha256=XBYCkxtYVAdUcch1784eHPAXlXfyfjco4WnRXxBHZYA,3273
|
96
|
-
stubber/utils/post.py,sha256=
|
97
|
-
stubber/utils/repos.py,sha256=
|
98
|
-
stubber/utils/stubmaker.py,sha256=
|
99
|
+
stubber/utils/post.py,sha256=0BvtaVPecDtIMTbMDaGaQToaB-wzzy2A2gXTBqGDcMY,2833
|
100
|
+
stubber/utils/repos.py,sha256=khPSxblc5zCdzVF7C6JtvcWFkgLIPRrSUTMtMcrRL3w,5606
|
101
|
+
stubber/utils/stubmaker.py,sha256=jHvRbbJA-Hp60R8NKct-TNM8ufFy2Rl2hesMW7ia7L8,4693
|
99
102
|
stubber/utils/typed_config_toml.py,sha256=ikifCIZGNhS_uqsfp6IwIpxdtZqbLtywprjWG_Q0y8o,2629
|
100
103
|
stubber/utils/versions.py,sha256=_xSOwpJV0gAO-TK2KHu-Ze3m__739f1YUVIxiHE2vqY,1859
|
101
104
|
stubber/variants.py,sha256=Tm5PfHwKa_rrKAYWXtiNompqAJcD_DOV1B6lJD7L5Bg,3747
|
102
|
-
micropython_stubber-1.
|
103
|
-
micropython_stubber-1.
|
104
|
-
micropython_stubber-1.
|
105
|
-
micropython_stubber-1.
|
106
|
-
micropython_stubber-1.
|
105
|
+
micropython_stubber-1.15.1.dist-info/entry_points.txt,sha256=NQi_M36fgq5k6giSuASas3LrpF6CVdkzfvJC0ja73_g,55
|
106
|
+
micropython_stubber-1.15.1.dist-info/LICENSE,sha256=2zsOXlYgl9W7_XGXcncAXIYfvSVlyNcVBycC6hhlKhA,1542
|
107
|
+
micropython_stubber-1.15.1.dist-info/METADATA,sha256=IMj5-66gCyYaozwTM-4xSvon8a8QpUAWFf-OwTYntDk,18938
|
108
|
+
micropython_stubber-1.15.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
109
|
+
micropython_stubber-1.15.1.dist-info/RECORD,,
|
stubber/__init__.py
CHANGED
stubber/basicgit.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"""
|
2
2
|
Simple Git module, where needed via powershell
|
3
3
|
|
4
|
-
Some of the functions are based on the
|
4
|
+
Some of the functions are based on the PyGithub module
|
5
5
|
"""
|
6
6
|
import os
|
7
7
|
import subprocess
|
@@ -9,14 +9,18 @@ from pathlib import Path
|
|
9
9
|
from typing import List, Optional, Union
|
10
10
|
|
11
11
|
import cachetools.func
|
12
|
-
from github import Github
|
12
|
+
from github import Auth, Github
|
13
13
|
from loguru import logger as log
|
14
14
|
from packaging.version import parse
|
15
15
|
|
16
16
|
# Token with no permissions
|
17
|
-
PAT_NO_ACCESS =
|
17
|
+
PAT_NO_ACCESS = (
|
18
|
+
"github_pat"
|
19
|
+
+ "_11AAHPVFQ0IwtAmfc3cD5Z"
|
20
|
+
+ "_xOVII22ErRzzZ7xwwxRcNotUu4krMMbjinQcsMxjnWkYFBIDRWFlZMaHSqq"
|
21
|
+
)
|
18
22
|
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
19
|
-
GH_CLIENT = Github(PAT)
|
23
|
+
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
20
24
|
|
21
25
|
|
22
26
|
def _run_local_git(
|
@@ -31,7 +35,9 @@ def _run_local_git(
|
|
31
35
|
if repo:
|
32
36
|
if isinstance(repo, str):
|
33
37
|
repo = Path(repo)
|
34
|
-
result = subprocess.run(
|
38
|
+
result = subprocess.run(
|
39
|
+
cmd, capture_output=capture_output, check=True, cwd=repo.absolute().as_posix()
|
40
|
+
)
|
35
41
|
else:
|
36
42
|
result = subprocess.run(cmd, capture_output=capture_output, check=True)
|
37
43
|
except (NotADirectoryError, FileNotFoundError) as e: # pragma: no cover
|
@@ -42,11 +48,14 @@ def _run_local_git(
|
|
42
48
|
return None
|
43
49
|
if result.stderr and result.stderr != b"":
|
44
50
|
stderr = result.stderr.decode("utf-8")
|
51
|
+
if "cloning into" in stderr.lower():
|
52
|
+
# log.info(stderr)
|
53
|
+
expect_stderr = True
|
45
54
|
if "warning" in stderr.lower():
|
46
55
|
log.warning(stderr)
|
47
56
|
expect_stderr = True
|
48
57
|
elif capture_output and echo_output: # pragma: no cover
|
49
|
-
log.
|
58
|
+
log.info(stderr)
|
50
59
|
if not expect_stderr:
|
51
60
|
raise ChildProcessError(stderr)
|
52
61
|
|
@@ -69,7 +78,9 @@ def clone(remote_repo: str, path: Path, shallow: bool = False, tag: Optional[str
|
|
69
78
|
return False
|
70
79
|
|
71
80
|
|
72
|
-
def get_local_tag(
|
81
|
+
def get_local_tag(
|
82
|
+
repo: Optional[Union[str, Path]] = None, abbreviate: bool = True
|
83
|
+
) -> Union[str, None]:
|
73
84
|
"""
|
74
85
|
get the most recent git version tag of a local repo
|
75
86
|
repo Path should be in the form of : repo = "./repo/micropython"
|
@@ -81,7 +92,11 @@ def get_local_tag(repo: Optional[Union[str, Path]] = None, abbreviate: bool = Tr
|
|
81
92
|
elif isinstance(repo, str):
|
82
93
|
repo = Path(repo)
|
83
94
|
|
84
|
-
result = _run_local_git(
|
95
|
+
result = _run_local_git(
|
96
|
+
["git", "describe", "--tags"],
|
97
|
+
repo=repo.as_posix(),
|
98
|
+
expect_stderr=True,
|
99
|
+
)
|
85
100
|
if not result:
|
86
101
|
return None
|
87
102
|
tag: str = result.stdout.decode("utf-8")
|
@@ -149,13 +164,14 @@ def checkout_tag(tag: str, repo: Optional[Union[str, Path]] = None) -> bool:
|
|
149
164
|
return True
|
150
165
|
|
151
166
|
|
152
|
-
def
|
167
|
+
def sync_submodules(repo: Optional[Union[Path, str]] = None) -> bool:
|
153
168
|
"""
|
154
|
-
make sure any submodules are in
|
169
|
+
make sure any submodules are in sync
|
155
170
|
"""
|
156
171
|
cmds = [
|
157
172
|
["git", "submodule", "sync", "--quiet"],
|
158
|
-
["git", "submodule", "update", "--quiet"],
|
173
|
+
# ["git", "submodule", "update", "--quiet"],
|
174
|
+
["git", "submodule", "update", "--init", "lib/micropython-lib"],
|
159
175
|
]
|
160
176
|
for cmd in cmds:
|
161
177
|
if result := _run_local_git(cmd, repo=repo, expect_stderr=True):
|
@@ -176,7 +192,6 @@ def checkout_commit(commit_hash: str, repo: Optional[Union[Path, str]] = None) -
|
|
176
192
|
return False
|
177
193
|
# actually a good result
|
178
194
|
log.debug(result.stderr.decode("utf-8"))
|
179
|
-
synch_submodules(repo)
|
180
195
|
return True
|
181
196
|
|
182
197
|
|
@@ -194,7 +209,6 @@ def switch_tag(tag: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
|
194
209
|
return False
|
195
210
|
# actually a good result
|
196
211
|
log.debug(result.stderr.decode("utf-8"))
|
197
|
-
synch_submodules(repo)
|
198
212
|
return True
|
199
213
|
|
200
214
|
|
@@ -211,7 +225,6 @@ def switch_branch(branch: str, repo: Optional[Union[Path, str]] = None) -> bool:
|
|
211
225
|
return False
|
212
226
|
# actually a good result
|
213
227
|
log.debug(result.stderr.decode("utf-8"))
|
214
|
-
synch_submodules(repo)
|
215
228
|
return True
|
216
229
|
|
217
230
|
|