-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Handle cwd correctly in pyinfo #13161
Conversation
This fixes a recent regression introduced by the change to use sys.path Fixes python#12956
In the issue, Ethan mentioned an alternate possible resolution is to also search the pythonpath for stub packages. I think that's a slightly larger change and we can always do it later. I think we'd want this PR regardless, since it keeps behaviour more consistent across |
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Good catch.
This fixes a recent regression introduced by the change to use sys.path Fixes python#12956
Just ran into another behaviour that #11143 changed that this PR changes back to that of mypy 0.961. mypy silences errors on package_path. Since cwd stopped being on package_path, even if we had an editable install of cwd, we stopped silencing these errors. I think the original + this PR, silencing behaviour is actually correct, but I'm not 100% sure. Line 2458 in a6166b2
This wouldn't usually affect mypy, since people rarely check a single module within a package, so we'd have a path here for any BuildSource Line 1821 in a6166b2
(It's still a little unclear what I'd need to do to get mypy to report the pandas errors I was seeing via stubtest. Maybe a configuration thing?) |
We run mypy/pyinfo.py as a script, and this means that mypy/types.py could be picked up instead of the stdlib `types` module, which clearly doesn't work. This seems to happen at least on macOS, and it broke PEP 561 tests. The workaround was accidentally removed as part of #13161. This should fix #13174 and help with the wheel builds.
…#13176) We run mypy/pyinfo.py as a script, and this means that mypy/types.py could be picked up instead of the stdlib `types` module, which clearly doesn't work. This seems to happen at least on macOS, and it broke PEP 561 tests. The workaround was accidentally removed as part of #13161. This should fix #13174 and help with the wheel builds.
…#13176) We run mypy/pyinfo.py as a script, and this means that mypy/types.py could be picked up instead of the stdlib `types` module, which clearly doesn't work. This seems to happen at least on macOS, and it broke PEP 561 tests. The workaround was accidentally removed as part of #13161. This should fix #13174 and help with the wheel builds.
This fixes a recent regression introduced by the change to
use sys.path
Fixes #12956