stubber.freeze.get_frozen

Collect modules and python stubs from MicroPython source projects (v1.12 +) and stores them in the all_stubs folder The all_stubs folder should be mapped/symlinked to the micropython_stubs/stubs repo/folder

Module Contents

Functions

get_manifests(→ List[pathlib.Path])

Returns a list of all manifests.py files found in the ports folder of the MicroPython repo

add_comment_to_path(→ None)

Add a comment to the top of each file in the path

freeze_any(→ pathlib.Path)

Get and parse the to-be-frozen .py modules for micropython to extract the static type information

get_fsp(→ pathlib.Path)

Attributes

FAMILY

stubber.freeze.get_frozen.FAMILY = 'micropython'
stubber.freeze.get_frozen.get_manifests(mpy_path: pathlib.Path) List[pathlib.Path]

Returns a list of all manifests.py files found in the ports folder of the MicroPython repo

Parameters:

mpy_path (pathlib.Path) –

Return type:

List[pathlib.Path]

stubber.freeze.get_frozen.add_comment_to_path(path: pathlib.Path, comment: str) None

Add a comment to the top of each file in the path using a codemod

Parameters:
Return type:

None

stubber.freeze.get_frozen.freeze_any(stub_folder: pathlib.Path | None = None, version: str = V_PREVIEW, mpy_path: pathlib.Path | None = None, mpy_lib_path: pathlib.Path | None = None) pathlib.Path
Get and parse the to-be-frozen .py modules for micropython to extract the static type information
  • requires that the MicroPython and Micropython-lib repos are checked out and available on a local path

  • repos should be cloned side-by-side as some of the manifests refer to micropython-lib scripts using a relative path

The micropython-* repos must be checked out to the required version/tag.

Parameters:
Return type:

pathlib.Path

stubber.freeze.get_frozen.get_fsp(version: str, stub_folder: pathlib.Path | None = None) pathlib.Path
Parameters:
Return type:

pathlib.Path