-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cannot manage to make the stubs used by PyCharm. #2
Comments
Hmmm... you're right. I deleted the .pyi stubs from I found this issue that was made for a similar problem, but there was no resolution. This problem may be specific to compiled modules (.dll, .so). One possible solution is to distribute these as stubs for |
Thanks your suggested workaround looks the way to go. |
I'm trying to understand that as well. In PyCharm there are 3 layers of stubs for PySide2:
As far as PyCharm is concerned the order of precedence seems to be the order that I've listed above. It uses the .pyi files in PySide2, but when I delete them it uses its own stubs that it generates from inspecting PySide, and only after removing PySide2 from the venv does PyCharm look at the pyi files in PySide2-stubs. The other question is what does PEP 561 say about the order of precedence between stubs within a package (PySide2) and stubs within a stubs-only package (PySide2-stubs)? In other words, what is the correct behavior that should be implemented by IDEs like mypy and type checkers like mypy? A quick skim suggests this may not be well defined. I'm going to leave this open until I have something better than what we have now, probably something with providing |
Even though it was defined and for example Else here is my current solution for my project, that work with poetry. That way anyone can just rebuild the venv on his side. |
Hello, I have been trying to get your stubs working alongside my PyCharm project.
I am using Qt.py from which
types-PySide
is perfectly installed using1.3.8
. But they are not being picked by PyCharm at all.The reasons for now are :
External Libraries/Binary Skeletons
.pip install PySide2 --target "somedir/"
, look at the content ofsomedir
and notice a.pyi
file for each root Qt module. Again I can deleted those manually but though it's not a good practice as this need to be performed at each venv update.Here is a screenshot of the
site-packages
directory of the venv :So this would actually be more of a "discussion" than an "issue" as there is no issue with
types-PySide
directly, just PyCharm being annoying to work with. I'm still creating the issue so it can maybe help other people having the same issue.I'm looking for any advice on the resolution that would involve minimal hackery.
PySide2-stubs
stubs take priority over the .pyi files inPySide2
directory ?Feel free to close this if you don't estimate it's the right place to discuss it.
Cheers.
Liam.
The text was updated successfully, but these errors were encountered: