stubber¶
stubber [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Options
- --version¶
Show the version and exit.
- -v, --verbose¶
-v for DEBUG, -v -v for TRACE
build¶
Commandline interface to publish stubs.
stubber build [OPTIONS]
Options
- --family <family>¶
- Default:
micropython
- -V, --version, --Version <versions>¶
multiple:
- Default:
v1.21.0
- -p, --port <ports>¶
multiple:
- Default:
all
- -b, --board <boards>¶
multiple:
- Default:
GENERIC
- --clean¶
clean folders after processing and publishing
- --force¶
build package even if no changes detected
clone¶
Clone/fetch the micropython repos locally.
The local repos are used to generate frozen-stubs and doc-stubs.
stubber clone [OPTIONS]
Options
- -p, --path <path>¶
- --add-stubs, --no-stubs¶
Also clone the micropython-stubs repo
enrich¶
Enrich the stubs in stub_folder with the docstubs in docstubs_folder.
stubber enrich [OPTIONS]
Options
- -s, --stubs <stubs_folder>¶
folder containing the firmware stubs to be updated
- Default:
repos/micropython-stubs/stubs
- -ds, --docstubs <docstubs_folder>¶
folder containing the docstubs to be applied
- Default:
repos/micropython-stubs/stubs
- --diff¶
Show diff
- Default:
False
- --dry-run¶
Dry run does not write the files back
- Default:
False
get-core¶
Download core CPython stubs from PyPi.
Get the core (CPython compat) modules for both MicroPython and Pycopy.
stubber get-core [OPTIONS]
Options
- -stubs, --stub-folder <stub_folder>¶
- Default:
repos/micropython-stubs/stubs
- --stubgen, --no-stubgen¶
run stubgen to create .pyi files for the (new) frozen modules
- Default:
True
- --black, --no-black¶
Run black on the (new) frozen modules
- Default:
True
get-docstubs¶
Build stubs from documentation.
Read the Micropython library documentation files and use them to build stubs that can be used for static typechecking.
stubber get-docstubs [OPTIONS]
Options
- -p, --path <path>¶
- Default:
repos
- --stub-path, --stub-folder <target>¶
Destination of the files to be generated.
- Default:
repos/micropython-stubs/stubs
- --version, --tag <version>¶
Version number to use. [default: Git tag]
- -b, --black, -nb, --no-black¶
Run black
- Default:
True
get-frozen¶
Get the frozen stubs for MicroPython.
Get the frozen modules for the checked out version of MicroPython
stubber get-frozen [OPTIONS]
Options
- -stubs, --stub-folder <stub_folder>¶
- Default:
repos/micropython-stubs/stubs
- -V, --version, --Version <version>¶
- Default:
- --stubgen, --no-stubgen¶
Run stubgen to create .pyi files for the (new) frozen modules
- Default:
True
- --black, --no-black¶
Run black on the (new) frozen modules
- Default:
True
get-lobo¶
Get the frozen stubs for Lobo-esp32.
stubber get-lobo [OPTIONS]
Options
- -stubs, --stub-folder <stub_folder>¶
- Default:
repos/micropython-stubs/stubs
- --pyi, --no-pyi¶
Create .pyi files for the (new) frozen modules
- Default:
True
- --black, --no-black¶
Run black on the (new) frozen modules
- Default:
True
make-variants¶
Update all variants of createstubs*.py.
stubber make-variants [OPTIONS]
Options
- -t, --target <target_folder>¶
Target folder for the createstubs*.py/.mpy files
- -V, --version, --Version <version>¶
The version of mpy-cross to use
- Default:
v1.21.0
merge¶
Enrich the stubs in stub_folder with the docstubs in docstubs_folder.
stubber merge [OPTIONS]
Options
- --family <family>¶
- Default:
micropython
- -V, --version, --Version <versions>¶
‘latest’, ‘auto’, or one or more versions
- Default:
all
- -p, --port <ports>¶
multiple:
- Default:
all
- -b, --board <boards>¶
multiple:
- Default:
generic
minify¶
Minify createstubs*.py.
Creates a minified version of the SOURCE micropython file in TARGET (file or folder). The goal is to use less memory / not to run out of memory, while generating Firmware stubs.
stubber minify [OPTIONS]
Options
- -s, --source <source>¶
- Default:
createstubs.py
- -d, --diff¶
Show the functional changes made to the source script.
- -c, -xc, --compile¶
Cross compile after minification.
- -a, --all¶
Minify all variants (normal, _mem and _db).
- --report, --no-report¶
Keep or disable minimal progress reporting in the minified version.
- Default:
True
publish¶
Commandline interface to publish stubs.
stubber publish [OPTIONS]
Options
- --family <family>¶
- Default:
micropython
- -V, --version, --Version <versions>¶
multiple:
- Default:
v1.21.0
- -p, --port <ports>¶
multiple:
- Default:
all
- -b, --board <boards>¶
multiple:
- Default:
GENERIC
- --pypi, --test-pypi¶
publish to PYPI or Test-PYPI
- Default:
False
- --build¶
build before publish
- --force¶
create new post release even if no changes detected
- --dry-run¶
Do not actually publish, just show what would be done
- --clean¶
clean folders after processing and publishing
show-config¶
Show the current configuration
stubber show-config [OPTIONS]
stub¶
Create or update .pyi type hint files.
stubber stub [OPTIONS]
Options
- -s, --source <source>¶
switch¶
Switch to a specific version of the micropython repos.
The Micropython-lib repo will be checked out to a commit that corresponds in time to that version tag, in order to allow non-current versions to be stubbed correctly.
The repros must be cloned already
stubber switch [OPTIONS] [[v1.10|v1.11|v1.12|v1.13|v1.14|v1.15|v1.16|v1.17|v1.
18|v1.19|v1.19.1|v1.20.0|v1.21.0|v1.22.0-preview|v1.9.3|v1.9.4|
latest]]
Options
- -p, --path <path>¶
Arguments
- TAG¶
Optional argument
update-fallback¶
Update the fallback stubs.
The fallback stubs are updated/collated from files of the firmware-stubs, doc-stubs and core-stubs.
stubber update-fallback [OPTIONS]
Options
- --version <version>¶
Version number to use
- Default:
v1_18
- --stub-folder <stub_folder>¶
Destination of the files to be generated.
- Default:
repos/micropython-stubs/stubs
update-module-list¶
Update the module list based on the information in the data folder
stubber update-module-list [OPTIONS]