You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gen/gen_mpy: Add Python stub file generation for IDE support.
Extends the LVGL bindings generator to automatically create Python stub
files (.pyi) that provide type hints and enable IDE autocompletion for
LVGL MicroPython bindings.
Features:
- Type mapping from C types to Python type hints
- Single stub file with all widgets, functions, enums, and constants
- Detailed documentation header with content statistics
The generated lvgl.pyi file includes 40+ widget classes, 300+ functions,
and comprehensive type information for better development experience.
Include C function names, location and description in Python stub docstrings.
The docstrings include a "C function: <name>" line before the
"Source: <file>:<line>" reference. For example:
- Python method `delete()` shows "C function: lv_obj_delete"
- Python method `add_flag()` shows "C function: lv_obj_add_flag"
Create a proper Python package structure for LVGL type stubs:
- Create stubs/pyproject.toml with setuptools-scm versioning
- Add stubs/lvgl-stubs/ package directory with __init__.py and py.typed
- Update gen_mpy.py to output stubs to package directory by default
- Add .gitignore to exclude generated .pyi files but include package structure
- Update README.md with comprehensive IDE support documentation
Signed-off-by: Andrew Leech <andrew@alelec.net>
For better development experience with IDEs (VS Code, PyCharm, etc.), this repository includes Python type stubs that provide autocompletion, type checking, and documentation hints.
513
+
514
+
### Installation
515
+
516
+
The type stubs are automatically generated during the build process and packaged for easy installation:
0 commit comments