stubber.stubber
¶
Pre/Post Processing for createstubs.py
Module Contents¶
Functions¶
|
Common post processing |
|
|
|
Clone the micropython repos locally to be able to generate frozen-stubs and doc-stubs. |
|
Create or update .pyi type hint files for all .py files in SOURCE path. |
|
Creates a minified version of the SOURCE micropython file in TARGET (file or folder). |
|
Get the frozen modules for the checked out version of MicroPython |
|
Get the frozen modules for the Loboris v3.2.24 fork of MicroPython |
|
Get the core (CPython compat) modules for both MicroPython and Pycopy. |
|
Read the Micropython library documentation files and use them to build stubs that can be used for static typechecking. |
Attributes¶
- stubber.stubber.STUB_FOLDER = ./all-stubs¶
- stubber.stubber.MPY_FOLDER = ./micropython¶
- stubber.stubber.MPY_LIB_FOLDER = ./micropython-lib¶
- stubber.stubber.log¶
- stubber.stubber.do_post_processing(stub_paths: List[pathlib.Path], pyi: bool, black: bool)¶
Common post processing
- Parameters
stub_paths (List[pathlib.Path]) –
pyi (bool) –
black (bool) –
- stubber.stubber.stubber_cli(ctx, debug=False)¶
- stubber.stubber.cli_init(mpy: bool, mpy_lib: bool, path: Union[str, pathlib.Path])¶
Clone the micropython repos locally to be able to generate frozen-stubs and doc-stubs.
- Parameters
mpy (bool) –
mpy_lib (bool) –
path (Union[str, pathlib.Path]) –
- stubber.stubber.cli_stub(source: Union[str, pathlib.Path])¶
Create or update .pyi type hint files for all .py files in SOURCE path.
- Parameters
source (Union[str, pathlib.Path]) –
- stubber.stubber.cli_minify(ctx, source: Union[str, pathlib.Path], target: Union[str, pathlib.Path], keep_report: bool, diff: bool, cross_compile: bool, all: bool) int ¶
Creates a minified version of the SOURCE micropython file in TARGET (file or folder).
- Parameters
source (Union[str, pathlib.Path]) –
target (Union[str, pathlib.Path]) –
keep_report (bool) –
diff (bool) –
cross_compile (bool) –
all (bool) –
- Return type
- stubber.stubber.cli_get_frozen(stub_folder: str = STUB_FOLDER, mpy_folder: str = MPY_FOLDER, mpy_lib_folder: str = MPY_LIB_FOLDER, version: str = '', pyi: bool = True, black: bool = True)¶
Get the frozen modules for the checked out version of MicroPython
- stubber.stubber.cli_get_lobo(stub_folder: str = STUB_FOLDER, pyi: bool = True, black: bool = True)¶
Get the frozen modules for the Loboris v3.2.24 fork of MicroPython
- stubber.stubber.cli_get_core(stub_folder: str = STUB_FOLDER, pyi: bool = True, black: bool = True)¶
Get the core (CPython compat) modules for both MicroPython and Pycopy.