Skip to content

Update micropython-stdlib

Choose a tag to compare

@Josverl Josverl released this 26 Dec 13:18
· 1205 commits to main since this release

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.