Releases: Josverl/micropython-stubber
Revise stub merge architecture to provide detailed parameter type hints and return types
The main change is a refactor of the docstub merging process, which now makes use of a set of reference stubs with parameter type information that is missing from , or only avaialble in the description, the micropython documentation.
The new build-chain follows the following steps and logic:
The subber tool is used to :
-
switch to a specific version of the micropython library documentation.
stubber clone
stubber switch stable
-
Generate docstubs from the micropython library documentation.
This part has recieved significant updates , and makes use of new additions to the code-refactoring and merging logic that has received significant updates.
tghis allows to enrich the doc-stubs with return and parameter type information from the reference stubs.
The result has the docstrings based on the micropython documentation, and the parameter and return types are based on the reference-stubs.
This also allows for methods or classes that are not mentioned or missing in the MicroPython documentation to be included in the docstubs.
stubber docstubs --enrich
-
Optionally: update
micropython-stdlib-stubs
with the new docstubs.
Updating the docstubs also takes advantage of the new functionality to enrich the target with the parameter and return type information from the reference-stubs.
(also see the stdlib section below)
python build.py
(in stubs-repo: publish\micropython-stdlib-stubs) -
Generate stubs for the frozen modules for the specific version of micropython. [can be done out-of-sequence]
This retrieves the frozen modules for all ports and boards from the micropython repository, and generates the stubs for them.
These stubs are enriched with the parameter and return type information from the doc-stubs.
stubber frozen --version {version}
-
Create firmware-stubs for a specific MCU and firmware. [can be done out-of-sequence]
The firmware shouild be flashed to the MCU, and it should be conencted via USB or serial.
stubber MCU
-
The MCU-stubs are merged with the docstubs.
stubber merge --port {port} --board {board} --version {version}
-
During this step the distribution packages are built by combining files from the merged-stubs, the frozen-stubs , and a few micropython-core files.
Only a few chages have been done to this part of the build-chain.
All package information is now stored in a SQLite database for change detection.
stubber build --port {port} --board {board} --version {version}
-
Publish the distribution packages to pypi , and update the database with the relevant hashes for change detection.
Only a few chages have been done to this part of the build-chain.
All package information is now stored in a SQLite database for change detection.
stubber publish --port {port} --board {board} --version {version}
Docstub Merges & Enrichment
Refactors docstub merging, adds type details, and streamlines overload handling.
- stubber: Merge
@ overload
(series of commits 1–5)
Add functionality to merge source and target containing@ overload
decorators, where the the source-stub can have multiple decoroators. - Added ability to merge only the parameter type info, without overwriting existing docstrings.
- Updated algorithm to match the source and destination candidates to avoid applying the same source to multiple destinations and other forms of duplication
- Reduced the number of module specific configurations that were part of stubber.rst.lookup ( can now be done directly in the reference-stubs)
- Merge TypeAliases / TypeVars
With the additional type information in the reference-stubs, the docstubs can now be enriched with the parameter and return type information from the reference-stubs. For this more TypeAliases and TypeVars have been added to the reference-stubs, that also need to be taken into account during the merge.
The merge process has been updated to handle these cases.
What's Changed
- build(deps): bump importlib-metadata from 7.1.0 to 8.0.0 by @dependabot in #593
- build(deps-dev): bump ipykernel from 6.29.4 to 6.29.5 by @dependabot in #600
- build(deps-dev): bump sphinx-click from 5.1.0 to 6.0.0 by @dependabot in #597
- build(deps): bump mypy from 1.9.0 to 1.10.1 by @dependabot in #594
- build(deps): bump libcst from 1.3.1 to 1.4.0 by @dependabot in #596
- build(deps): bump pyright from 1.1.361 to 1.1.370 by @dependabot in #601
- Migrate database management to SQLite and enhance table formatting by @Josverl in #631
- mpflash: Fix macOS specific ports scanning issues by @Josverl in #634
- Stubber: Fix retrieving the hashes from the database during build & publish. by @Josverl in #638
- Enhance board ID handling and repository fetching by @Josverl in #632
Full Changelog: v1.23.1...v1.24.0
v1.23.1
v1.23.0
v1.20.4
mpflash
What's Changed
- Improve list display on 80 column terminals
- Allow filtering of serial ports for all commands
- Refactor handling of known board_ids and descriptions
- Update board_info list for the MicroPython v1.23.0 release
- Add
add_boards.py
script.
Full Changelog: mpflash-v0.7.0...mpflash_v0.8.0
v1.20.0
v1.19.0
stubber