Skip to content
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

wx.lib.* modules are not present in the stubs #30

Open
omar-abdelgawad opened this issue May 4, 2024 · 0 comments
Open

wx.lib.* modules are not present in the stubs #30

omar-abdelgawad opened this issue May 4, 2024 · 0 comments

Comments

@omar-abdelgawad
Copy link

omar-abdelgawad commented May 4, 2024

Hey I was using wxPython for the first time so I tried to install 3rd party stubs to ease my task of learning it. I am using VSCode with Pylance as my language server.

The problem is that some modules in the wx package don't have a corresponding stub in the wx-stubs (meaning that they are missing). Since Pylance by default searches for the stubs first, it raises an Import could not be resolved error even though without the stubs the error disappears.

image

Since the stubs were working nicely for me. I don't want to uninstall them just for these errors. However, I read some pyright (used by pylance) documentation and they are saying that there isn't and won't be a configuration that allows falling back to the source files of the original library if the stubs are missing something. Moreover, the maintainers even recommend not using any incomplete stubs.

Do you propose any workaround to this problem besides completely removing the stubs?

edit: I just found the following PEP 561 link that explains partial packages.
If a stub package distribution is partial it MUST include partial\n in a py.typed file.
Also this may be a useful related issue

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

No branches or pull requests

1 participant