-
-
Notifications
You must be signed in to change notification settings - Fork 478
Add missing py.typed File #2089
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
Sorry, I am not a pyright user. I cannot review :( |
Any other reviewers I could possibly ping? |
I don't use pyright either. Does this change affect any other type checker, if not, could we merge and try it out? |
According to PEP 561, stubs-only packages don't need to include
Did you try that this actually fixes the issue? I wasn't aware that VSCode or pyright bundle the django-types package. I'm willing to consider work-around hacks, but this is a problem caused by VSCode/pyright first and foremost. I think manually installed stubs should override the defaults. Please open an issue for them and see what they think. In any case, they are in a better position to suggest what the appropriate solution is. |
This is an existing issue on the Pylance side: microsoft/pylance-release#5031, so indeed not related to the missing |
From what I can tell, while it isn't required, it is a way of at least tricking Pylance into prioritizing it. |
OK, per issue linked by Viicos, this has been reported upstream and there hasn't been any progress for months. But did you test that this solves the issue with django-stubs? Usually it's also needed to change |
some of stub packages bundeld in pylance is a partial stub. py.typed file in them indicate it is partial stub not full stub See https://peps.python.org/pep-0561/#partial-stub-packages for more detail That said it sounds like a bug in import resolution order around partial stubs. U should open an issue in pylance |
Currently the lack of a
py.typed
file means that in VSCode the default bundled Django stubs (derived from djagno-types) are prioritized). This can make it quite confusing (for Pyright users) why you're seeing different results when running the Pyright CLI versus Pyright's type-checking in VSCode.For reference, one is present in Djagno-Types as well: https://github.com/sbdchd/django-types