-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
pyright gives types found in site-packages
higher priority than types found in typeshed
#10112
Comments
Interesting, would specifying the |
I just remembered that the setting |
There might be something in PEP 561 about this, but I don't know what the answer is off the top of my head. But it would certainly be convenient for us if the answer was "yes" :) (This also came up in #10090 (comment)) |
Typeshed is listed 5th in PEP 561's "Type checker module resolution order" section here. So the answer PEP 561 gives is that pyright is probably correct here in giving type hints found in (And that makes sense from the perspective of end users. It would be annoying if you'd installed an |
requirements-tests.txt
site-packages
higher priority than types found in typeshed
Can we consider this issue closed by #10121 ? The linked issue comments are a different problem that can be resolved with a different solution or just by waiting. |
Okay sure. Though I suspect the other problem will keep coming up, and it has a similar cause (insufficient isolation of the testing environment when we run pyright in CI). |
See this comment for context and example: #10058 (comment)
I think this only affects
pyyaml
andsetuptools
at the moment, as they are they onlytype-*
packages installed during tests.Can probably be fixed by specifying the
--typeshed-path
cli argument. Note that this would have to be done inpyright_test.py
and all Github actions. I have not tested this potential solution myself yet, and I didn't feel like doing this right now, hence this issue to remember.The text was updated successfully, but these errors were encountered: