stubber.publish.merge_docstubs

Merge firmware stubs and docstubs into a single folder.

Functions

merge_all_docstubs([versions, family, ports, boards, ...])

Merge docstubs and firmware stubs into merged stubs.

copy_and_merge_docstubs(fw_path, dest_path, docstub_path)

refactor_rp2_module(dest_path)

refactor the rp2 module to allow for submodules

patch_rp2_init_pyi(→ None)

Normalize generated rp2/__init__.pyi typing surface:

Module Contents

stubber.publish.merge_docstubs.merge_all_docstubs(versions: List[str] | str | None = None, family: str = 'micropython', ports: List[str] | str | None = None, boards: List[str] | str | None = None, clean: bool = True)

Merge docstubs and firmware stubs into merged stubs.

Parameters:
  • versions (Optional[Union[List[str], str]])

  • family (str)

  • ports (Optional[Union[List[str], str]])

  • boards (Optional[Union[List[str], str]])

  • clean (bool)

stubber.publish.merge_docstubs.copy_and_merge_docstubs(fw_path: pathlib.Path, dest_path: pathlib.Path, docstub_path: pathlib.Path, clean: bool = True)
Parameters:
  • fw_path (pathlib.Path) – Path to the source firmware stubs (absolute path)

  • dest_path (pathlib.Path) – Path to destination (absolute path)

  • docstub_path (pathlib.Path) – Path to docstubs

  • clean (bool)

Copy files from the firmware stub folders to the merged - 1 - Copy all firmware stubs to the package folder - 1.B - clean up a little bit - 2 - Enrich the firmware stubs with the document stubs

stubber.publish.merge_docstubs.refactor_rp2_module(dest_path: pathlib.Path)

refactor the rp2 module to allow for submodules

Parameters:

dest_path (pathlib.Path)

stubber.publish.merge_docstubs.patch_rp2_init_pyi(rp2_init_file: pathlib.Path) None

Normalize generated rp2/__init__.pyi typing surface: - suppress _PIO_ASM_Program: TypeAlias = Callable - keep PIOASMEmit opaque (only __init__ + __getattr__) - make _PIO_ASM_Program an opaque class without __getitem__

Parameters:

rp2_init_file (pathlib.Path)

Return type:

None