-
Notifications
You must be signed in to change notification settings - Fork 186
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
type stubs for pyimgui #364
Comments
I managed to run this generator on latest |
I'd like to reinforce the importance of this issue. It's a significant barrier to entry for a system that is meant to be simpler to implement, and has iffy documentation elsewhere. More new (capable) users means more contributors. There are several .pyi generation tools that could be incorporated into the build process. The "cost rule of ten" can be extended to the IDE: |
I agree that this is an important issue. Not only for code completion as @heyheyjc mentioned, but also for type validation CI/CD for dependent projects (e.g. mypy). I would be more than willing to take this up if @denballakh (or anyone else) does not want to do this. |
I have a repo with single-file stub for imgui. It is in very early stage, I dont have time to go through all functions and annotate them, I only annotate the stuff I am using. There are also tools that can generate stubs using runtime information. |
@denballakh Would you mind publishing this to pypi.org as a stub-only package, so that can be used before (or despite not) being integrated fully into the main package? See https://peps.python.org/pep-0561/#stub-only-packages and https://typing.readthedocs.io/en/latest/spec/distributing.html#stub-only-packages
(emphasis mine) I think at least for the time being, since this issue has been stalled for a while, this seems like a viable solution. If you don't want to do it, I would be willing to do it. |
Ok. |
@phistep I did it. I tested it locally, both mypy and pyright managed to find these stubs (and complained about errors in them). |
@denballakh It works very well for me and is much more flexible than storing the |
Are there any up-to-date type stubs for pyimgui?
Is there a way to autogenerate them from some source?
The text was updated successfully, but these errors were encountered: