stubber.freeze.common¶
common functions for frozen stub generation
Functions¶
|
returns a 3-tuple of the port, board and variant in the provided manifest path. |
|
get path to a folder to store the frozen stubs for the given port/board/variant. |
|
apply common fixes to the fozen modules to improve stub generation |
Module Contents¶
- stubber.freeze.common.get_portboard(manifest_path: pathlib.Path) Tuple[str, str, str]¶
returns a 3-tuple of the port, board and variant in the provided manifest path.
Stand-alone ports (e.g.
webassembly,unix,windows) do not use aboards/<board>/subfolder, but may have one or morevariants/<variant>/subfolders. For these theboardfield is empty whilevariantwill be set (e.g.pyscript).raises a ValueError if neither a port nor a board can be found
- Parameters:
manifest_path (pathlib.Path)
- Return type:
- stubber.freeze.common.get_freeze_path(stub_path: pathlib.Path, port: str, board: str, variant: str = '') Tuple[pathlib.Path, str]¶
get path to a folder to store the frozen stubs for the given port/board/variant.
For stand-alone ports (no
boards/folder) the variant is used as the folder name (e.g.webassembly/PYSCRIPT). When neither board nor variant is provided for a stand-alone port, the default variant namestandardis used instead of the legacyGENERICplaceholder.- Parameters:
stub_path (pathlib.Path)
port (str)
board (str)
variant (str)
- Return type:
Tuple[pathlib.Path, str]
- stubber.freeze.common.apply_frozen_module_fixes(freeze_path: pathlib.Path, mpy_path: pathlib.Path)¶
apply common fixes to the fozen modules to improve stub generation
- Parameters:
freeze_path (pathlib.Path)
mpy_path (pathlib.Path)