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
Refactor Python stub generation into dedicated module system:
- Create gen_stubs.py: Standalone script for generating Python type stubs
- Create gen_utils.py: Shared utilities between gen_mpy.py and gen_stubs.py
- Update gen_mpy.py: Remove stub generation code, import shared utilities
- Update pyproject.toml: Remove setuptools-scm, use __version__.py approach
The new system generates complete Python type stubs with:
- All LVGL widget classes with proper typing
- Function signatures with parameter names and types
- Enum definitions and constants
- Documentation extracted from C headers
- Validation to ensure stub-API consistency
Signed-off-by: Andrew Leech <[email protected]>
@@ -543,30 +573,60 @@ Once installed, your IDE will automatically provide:
543
573
544
574
### Building Stubs
545
575
546
-
The stubs are automatically generated when running the binding generation:
576
+
The stubs are generated using a separate `gen_stubs.py` module that creates both stub files and distributable wheel packages. Two make targets are available:
547
577
548
578
```bash
549
-
# Build with automatic stub generation
550
-
make USER_C_MODULES=/path/to/lv_binding_micropython/micropython.cmake
579
+
# Generate stub files only
580
+
make USER_C_MODULES=/path/to/lv_binding_micropython LVGL_STUBS
581
+
582
+
# Generate stub files and build distributable wheel package
583
+
make USER_C_MODULES=/path/to/lv_binding_micropython LVGL_STUBS_WHEEL
0 commit comments