-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Stubs for PyQt5 #2495
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
Comments
The question of stubs for large frameworks is now being discussed in #2491. But I think in this case it would make sense to first add the stubs to typeshed, since IIUC they don't require any mypy plugins to work and are already complete. |
I'd recommend making the stubs first available as a PEP 561 stub package. Previously we've had problems with stubs for large libraries generating bogus errors due to missing or incorrect definitions -- which is not a surprise, since testing large sets of stub files is hard. Having the stub available as an optional install would let people try it out and iron out any bugs before contributing it to typeshed. Here the problem is that at least mypy (possibly also other tools) bundle the entire typeshed, and if we include bad stubs, users may not be able to upgrade to the latest mypy version until the stubs have been fixed, which would be unfortunate. #2491 would work around the problem by making it possible to selectively decide which third party typeshed stubs to install, but it's unclear if/when it will be implemented. |
@jukka Thanks for the hint. I read through PEP 561 and think now that this is the way to go. This makes it easy to install stub-only packages for specific Python packages. I agree that it is more flexible and also easier to maintain a single stub-only package than an entire collection of those in typeshed. So I changed my PyQt5-stubs package to fit PEP 561 and will make it available on PyPi. A thought of mine: It would be great to have some kind of index for stub-only packages in the mypy documentation or in the typeshed Readme or Wiki. I recon this would be a huge help for anyone looking for stubs for specific packages. |
Agreed, this would be helpful. Typeshed might be a better place than mypy documentation, since stubs are useful with tools other than mypy, and there are sometimes pretty long gaps between mypy releases, so updates will take a while to get officially released. |
I would like to volunteer to start up such a list. I just need to know from you guys where to put it. |
Closing this here as the stubs are now distributed externally. I moved the list discussion over to #2531. |
I've managed to build up pretty decent stubs for PyQt5. I used the stub files that have been auto-generated during the PyQt5 build process as a starter. They were not useable at that state so I had to do lots of rewriting. However I' ve been working with the result for a while and though I don't claim for completeness it is a great help for building PyQt5 applications and I've been using it for half a year now.
I would like to see the stubs in the typeshed. So first I want to ask if a PyQt5 stub would be appreciated in the typeshed 3rd-party category?
If so I will contact the PyQt5 developers and ask for their permission to do so before creating a PR.
The text was updated successfully, but these errors were encountered: