Skip to content

Releases: Josverl/micropython-stubs

v1.1.2-micropython-stdlib

28 Jan 15:51
Compare
Choose a tag to compare

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: v1.1.1-micropython-stdlib...v1.1.2-micropython-stdlib

Thanks to @paulober for reporting.

Stubs for MicroPython v1.22.0

03 Jan 15:19
Compare
Choose a tag to compare

This release updates the majority of the stubs distribution packages to match the v1.22.0 release of MicroPython

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-stdlib

26 Dec 13:18
Compare
Choose a tag to compare

Functional changes:

Typechecking now works correctly for namedtuples.

No changes are needed ,
you may be able to remove some # type: ignore comments if you used them to suppress false-positive typechecking errors.

Details:

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

Thanks to North101 for reporting.

v1.21.0-webassembly

04 Dec 07:49
Compare
Choose a tag to compare

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

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

stubber_v1.15.0

18 Nov 21:09
Compare
Choose a tag to compare

New and updated packages published to PyPi

(.post1 indicates a new package, all others are updates)

Micropython Version Published Packages Post Version
v1.21.0
micropython-esp32-stubs 1.21.0.post3
micropython-esp32-esp32_generic-stubs 1.21.0.post1
micropython-rp2-stubs 1.21.0.post1
micropython-rp2-rpi_pico-stubs 1.21.0.post2
micropython-rp2-rpi_pico_w-stubs 1.21.0.post2
micropython-samd-stubs 1.21.0.post1
micropython-samd-seeed_wio_terminal-stubs 1.21.0.post2
micropython-stm32-stubs 1.21.0.post1
micropython-stm32-pybv11-stubs 1.21.0.post2
v1.20.0
micropython-esp32-stubs 1.20.0.post4
micropython-esp32-generic_ota-stubs 1.20.0.post1
micropython-esp32-generic_s3-stubs 1.20.0.post1
micropython-rp2-stubs 1.20.0.post4
micropython-rp2-pico-stubs 1.20.0.post4
micropython-rp2-pico_w-stubs 1.20.0.post4
micropython-samd-stubs 1.20.0.post1
micropython-samd-adafruit_feather_m4_express-stubs 1.20.0.post3
micropython-samd-adafruit_itsybitsy_m4_express-stubs 1.20.0.post3
micropython-samd-minisam_m4-stubs 1.20.0.post3
micropython-samd-seeed_wio_terminal-stubs 1.20.0.post4
micropython-stm32-stubs 1.20.0.post4
micropython-stm32-pybv11-stubs 1.20.0.post5
v1.19.1
micropython-esp32-stubs 1.19.1.post15
micropython-esp32-generic_s3-stubs 1.19.1.post1
micropython-esp32-generic_spiram-stubs 1.19.1.post1
micropython-esp32-um_tinypico-stubs 1.19.1.post8
micropython-esp8266-stubs 1.19.1.post12
micropython-rp2-stubs 1.19.1.post14
micropython-stm32-stubs 1.19.1.post12

Improvement in frozen stubs
Some of the module stubs are generated based on the python modules.
There usually contain little or no docstring information, while the documentation does have that infromation

The stubber tool has been updated to to merge the information from the documentation into these frozen stubs, providing combined and richer information where the two can be matched.

Enrich both Python and C modules
Some of the modules are built partly in (frozen) Python and partly in C(++). by convention the C part of the module is prefixes with an _
an example are the rp2 and the _rp2 modules where the classes and methos of both have been documented in a single document rp2/.st
The documentation merge process will now also enrich the _rp2.pyi and similar named stub files

Quality Testing.
In order to keep an eye on quality, and find cases where the stubs prove incorrect type-hints,
I have setup pytest with some custom configuration to track the quality.
Due to the diversity of features and functionality across ports, boards and versions this should help spot where stubs are not providing the expected/desired results.