ITADN
Josverl/micropython-stubs

版本发布 8

v1.25.0
? · 2025-04-17

This release matches the v1.25.0 release of MicroPython. https://github.com/micropython/micropython/releases/tag/v1.25.0 It also includes a number of updates and corrections to the reference stubs that are reflected in this release, | name | version | | -------------------------------------------|--------------| | micropython-esp32-stubs | 1.25.0.post1 | | micropython-esp32-esp32_generic-stubs | 1.25.0.post1 | | micropython-esp32-esp32_generic_c6-stubs | 1.25.0.post1 | | micropython-esp32-esp32_generic_s2-stubs | 1.25.0.post1 | | micropython-esp8266-stubs | 1.25.0.post1 | | micropython-esp8266-esp8266_generic-stubs | 1.25.0.post1 | | micropython-rp2-stubs | 1.25.0.post1 | | micropython-rp2-rpi_pico-stubs | 1.25.0.post1 | | micropython-rp2-rpi_pico2-stubs | 1.25.0.post1 | | micropython-rp2-rpi_pico2_w-stubs | 1.25.0.post1 | | micropython-rp2-rpi_pico_w-stubs | 1.25.0.post1 | | micropython-samd-stubs | 1.25.0.post1 | | micropython-samd-seeed_wio_terminal-stubs | 1.25.0.post1 | | micropython-stm32-stubs | 1.25.0.post1 | | micropython-stm32-pybv11-stubs | 1.25.0.post1 | | -------------------------------------------|--------------| ## What's Changed * Add ports by @Josverl in https://github.com/Josverl/micropython-stubs/pull/740 * Update createstubs.yml and firmware flashing process by @Josverl in https://github.com/Josverl/micropython-stubs/pull/749 * Add typing tests by @Josverl in https://github.com/Josverl/micropython-stubs/pull/757 * referecence-stubs/time : Use _Time8Tuple for all relevant time methods. by @Josverl in https://github.com/Josverl/micropython-stubs/pull/772 * fix: Add kwargs TypeVar. Accept bound & other by @markusand in https://github.com/Josverl/micropython-stubs/pull/777 * Reference/rp2 by @Josverl in https://github.com/Josverl/micropython-stubs/pull/779 * feat: Add Protocol by @markusand in https://github.com/Josverl/micropython-stubs/pull/795 * Enhance MicroPython stubs and improve type hints for compatibility by @Josverl in https://github.com/Josverl/micropython-stubs/pull/804 * Document additional static type checking without a typing module by @Josverl in https://github.com/Josverl/micropython-stubs/pull/805 * Corrected error in machine.UART.irq by @Tinyu-Zhao in https://github.com/Josverl/micropython-stubs/pull/809 ## New Contributors * @markusand made their first contribution in https://github.com/Josverl/micropython-stubs/pull/777 * @Tinyu-Zhao made their first contribution in https://github.com/Josverl/micropython-stubs/pull/809 **Full Changelog**: https://github.com/Josverl/micropython-stubs/compare/v1.22.0...v1.25.0

Support type checking using mypyv1.24.1.mypy
? · 2025-03-14

This update introduces several enhancements to the MicroPython stubs, including the addition of mathematical constants, improved type hints, and support for type checking using mypy . It also addresses various issues related to type compatibility and function signatures, ensuring better integration with MyPy and enhancing overall code quality. Notable changes include the addition of overloads for the typing module, updates to the os.stat specifications, and corrections to the handling of OrderedDict. Fixes issues #698, #750, #781, #789, and #799.

Update micropython boards stubs to v1.24.1v1.24.1-stubs
? · 2025-02-05

The new stubs contain additional type information for parameters and return types. The depend on new functionality added in `micropython-stdlib-stubs==1.24.1` esp32: - micropython-esp32-stubs **v1.24.1.post1** - micropython-esp32-esp32_generic-stubs **v1.24.1.post1** - micropython-esp32-esp32_generic_c6-stubs **v1.24.1.post1** - micropython-esp32-esp32_generic_s3-stubs **v1.24.1.post1** rp2: - micropython-rp2-stubs **v1.24.1.post1** - micropython-rp2-arduino_nano_rp2040_connect-stubs **v1.24.1.post1** - micropython-rp2-rpi_pico-stubs **v1.24.1.post1** - micropython-rp2-rpi_pico2-stubs **v1.24.1.post1** - micropython-rp2-rpi_pico_w-stubs **v1.24.1.post1** samd: - micropython-samd-stubs **v1.24.1.post1** - micropython-samd-seeed_wio_terminal-stubs **v1.24.1.post1** stm32: - micropython-stm32-stubs **v1.24.1.post1** - micropython-stm32-pybv11-stubs **v1.24.1.post1** ## Relevant and related updates in the MicroPython-stubs repo ### reference-stubs The reference stubs themselves are created using the stubber tool to combine and merge infromation from the following sources. - The v1.24.1 docstubs , generated from the micropython library documentation. - [PyBoardTypeshed](https://github.com/hlovatt/PyBoardTypeshed) created by Howard Lovatt - [PoC of type hints for the RP2 PIO assembler](https://github.com/Josverl/PIO_ASM_typing) by Jos Verlinde - Stubs for modules lacking documentation such as `_threads` and pars of `hashlib` and `random` - A new `_mpy_shed` module has been created based on the `_typeshed` module. This allows the different micropython stub modules to refer to common types and constants, that are different than the standard CPython types and constants. ### micropython-stdlib-stubs The stubs for the async and uasyncio modules of earlier versions had many issues. In this version, the stunb for `asyncio` are based on typeshed `stdlib.asyncio` stub, that has been tuned specifically for micropython by removing the features and functionality that is not available in MicroPython. However the Doc strings are taken from doc-stubs, to keep them in sync in line with the MicroPython Documentaion For distribution the `_mpy_shed` module is added to the `micropython-stdlib-stubs` package. Significant effort has been done to improve the ability for mypy to perform type checking on the micropython code, while maintaining compatibility with the way the micropython documentation, is structured. There are further improvement to be made, but this is a significant step forward for mypy users. While parts of the stdlib modules are hand-edited, they can be updated by running the `python build.py`. This functionality has not been merged into the stubber tool at this time.

MicroPython-stdlib-stubs 1.24.1 : Improved Type Checking, Documentation Sync, and _mpy_shed Integrationv1.24.1-stdlib
? · 2025-02-05

The stubs for the async and uasyncio modules of earlier versions had many issues. In this version, the stunb for `asyncio` are based on typeshed `stdlib.asyncio` stub, that has been tuned specifically for micropython by removing the features and functionality that is not available in MicroPython. However the Doc strings are taken from doc-stubs, to keep them in sync in line with the MicroPython Documentaion For distribution the `_mpy_shed` module is added to the `micropython-stdlib-stubs` package. Significant effort has been done to improve the ability for mypy to perform type checking on the micropython code, while maintaining compatibility with the way the micropython documentation, is structured. There are further improvement to be made, but this is a significant step forward for mypy users. While parts of the stdlib modules are hand-edited, they can be updated by running the `python build.py`. This functionality has not been merged into the stubber tool at this time. The stdlib stubs are now build using [`uv`](https://github.com/astral-sh/uv) which uses [`hatchling`](https://pypi.org/project/hatchling/)

v1.1.2-micropython-stdlib
? · 2024-01-28

## What's Changed Remove module top-level attributes from sys, collections, io and ssl modules Note that while in this release the top level attributes are limited to those available in MicroPython, the same is not yet implemented for top level classes and functions/methods **Full Changelog**: https://github.com/Josverl/micropython-stubs/compare/v1.1.1-micropython-stdlib...v1.1.2-micropython-stdlib Thanks to @paulober for reporting.

Stubs for MicroPython v1.22.0 v1.22.0
? · 2024-01-03

This release updates the majority of the stubs distribution packages to match the [v1.22.0 release of MicroPython ](https://github.com/orgs/micropython/discussions/13277) Ports and boards included in this release: - rp2 : based on RPI_PIO_W and RPI_PICO,, ARDUINO_NANO_RP2040_CONNECT, PIMORONI_PICOLIPO_16MB - esp32: based on esp32-GENERIC-SPIRAM - esp32S3: based on ESP32_GENERIC_S3 - samd: based on SEEED_WIO_TERMINAL - stm32: based on PYBV11 v1.22.0 Stubs for Unix, Windows and Webassembly will be published at a later time. _Note:_ The esp8266 stubs cannot be updated currently due to device constraints

Update micropython-stdlibv1.1.1-micropython-stdlib
? · 2023-12-26

This release is focused on `micropython-stdlib-stubs` and the packages that depend on it. - Rebuilt micropython-stdlib-stubs based on a recent version of the typeshed stdlib - Created a script to automate the rebuild, and allow future updates - Updated micropython-*-stubs to use the new `micropython-stdlib-stubs` - Updated micrpython-stubber with new functionality to automate this approach - additional stub-QA tests have been added to pytest and the CI workflow The stdlib/collections module needed to be updated with MicroPython specific configuration, as the typecheckers have special handling for `namedtuple` that only works if it is decalred in stdlib/collections, and not in other modules. In order to make this work : - the `micropython-stdlib-stubs` package now includes a copy of the `stdlib/collections` stub. - this has been updated with micropython specific docstring - `__all__` has been changed to only export micropython supported types - the `micropython-*-stubs` packages: - no longer include a copy of the `collections.pyi` stub - include a shim stub for ucollections.pyi that `imports * from collections` - have been updated `micropython-stdlib-stubs^=1.1.0`. micropython-*-stubs that have been updated to use the new `micropython-stdlib-stubs` are: - v1.19.1.* - v1.20.0.* - v1.21.0.* - prerelease a.k.a. latest

v1.21.0-webassembly
? · 2023-12-04

## New and updated packages published to PyPi (.post1 indicates a new package, all others are updates) | Micropython Version | Published Packages | Post Version | Package | |---------------------|--------------------|--------------|----| | v1.21.0 | | | | | | micropython-webassembly-stubs | 1.21.0.post1 | [PyPI](https://pypi.org/project/micropython-webassembly-stubs/)| The webassembly is based of stubs generated by running the webassembly version on NodeJS. The supported and available modules are assumed to be the same for the WEB and the NODE variants