Skip to content

Stub generation is missing some typedefs #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thatbudakguy opened this issue Feb 16, 2025 · 3 comments
Open

Stub generation is missing some typedefs #298

thatbudakguy opened this issue Feb 16, 2025 · 3 comments

Comments

@thatbudakguy
Copy link

Describe the bug
The stub generation step that creates lvgl.pyi does not include many typedefs at the top that are referenced later in the file, causing it to not be interpreted by the IDE.

Details
I had been using the stubs provided in this thread on the LVGL forums, but noticed that a few typedefs appeared to not match the actual compiled binary – understandable given that the thread is almost a year old at this point.

In looking to acquire new stubs, I noticed that the build command generates them for me (nice!). However, when I ported the generated lvgl.pyi file into the typings/ folder of my local unix micropython project, most of the typings couldn't be loaded. When I inspected the file, I saw a lot (hundreds) of warnings like Undefined name style_prop_t. It seemed that classes defined later in the file were referencing typedefs that didn't exist.

Comparing with the lvgl.pyi provided in the thread, I noticed that it included a section of typedefs at the top that began:

flag_t = int
rb_color_t = int
thread_prio_t = int
[...]

This appears to be missing from the lvgl.pyi that was generated during my build.

Build Command

OS: macOS 15.3.1
CPU: Apple M3 Pro

python make.py macOS DISPLAY=sdl_display INDEV=sdl_pointer
@kdschlosser
Copy link
Collaborator

I am aware that there is quite a bit that is not right in it. Feel free to fix things and submit PR's for it.

@kdschlosser
Copy link
Collaborator

I am working on a new script to generate the stub file. I just wanted to let you know that I was doing that.

@kdschlosser
Copy link
Collaborator

If you want to have a look over it to see if there are any errors in it.

lvgl.pyi.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants