stubber.publish.package

prepare a set of stub files for publishing to PyPi

Module Contents

Functions

package_name(→ str)

generate a package name for the given package type

get_package(→ stubber.publish.stubpackage.StubPackage)

Get the package from the database or create a new one if it does not exist.

get_package_info(→ Union[Dict, None])

get a package's record from the json db if it can be found

create_package(→ stubber.publish.stubpackage.StubPackage)

create and initialize a package with the correct sources

combo_sources(→ stubber.publish.stubpackage.StubSources)

Build a source set for combo stubs

stubber.publish.package.package_name(pkg_type: str, *, port: str = '', board: str = '', family: str = 'micropython', **kwargs) str

generate a package name for the given package type

Parameters:
  • pkg_type (str) –

  • port (str) –

  • board (str) –

  • family (str) –

Return type:

str

stubber.publish.package.get_package(db: pysondb.PysonDB, *, pkg_type: str, version: str, port: str, board: str = GENERIC_L, family: str = 'micropython') stubber.publish.stubpackage.StubPackage

Get the package from the database or create a new one if it does not exist.

Parameters:
  • db (pysondb.PysonDB) –

  • pkg_type (str) –

  • version (str) –

  • port (str) –

  • board (str) –

  • family (str) –

Return type:

stubber.publish.stubpackage.StubPackage

stubber.publish.package.get_package_info(db: pysondb.PysonDB, pub_path: pathlib.Path, *, pkg_name: str, mpy_version: str) Dict | None

get a package’s record from the json db if it can be found matches om the package name and version

pkg_name: package name (micropython-esp32-stubs) mpy_version: micropython/firmware version (1.18)

Parameters:
  • db (pysondb.PysonDB) –

  • pub_path (pathlib.Path) –

  • pkg_name (str) –

  • mpy_version (str) –

Return type:

Union[Dict, None]

stubber.publish.package.create_package(pkg_name: str, mpy_version: str, *, port: str = '', board: str = '', family: str = 'micropython', pkg_type: str = COMBO_STUBS) stubber.publish.stubpackage.StubPackage

create and initialize a package with the correct sources

Parameters:
  • pkg_name (str) –

  • mpy_version (str) –

  • port (str) –

  • board (str) –

  • family (str) –

  • pkg_type (str) –

Return type:

stubber.publish.stubpackage.StubPackage

stubber.publish.package.combo_sources(family: str, port: str, board: str, ver_flat: str) stubber.publish.stubpackage.StubSources

Build a source set for combo stubs

Parameters:
  • family (str) –

  • port (str) –

  • board (str) –

  • ver_flat (str) –

Return type:

stubber.publish.stubpackage.StubSources