-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
sys.path change breaks editable installs of cwd #12956
Labels
bug
mypy got something wrong
Comments
I think the best thing to do is search for stub packages in the python path as well. We've had requests for this in the past, and with #8545 any extra packages can be disabled if need be. (Also from a consistency standpoint this would be simpler) |
hauntsaninja
added a commit
to hauntsaninja/mypy
that referenced
this issue
Jul 17, 2022
This fixes a recent regression introduced by the change to use sys.path Fixes python#12956
hauntsaninja
added a commit
to hauntsaninja/mypy
that referenced
this issue
Jul 17, 2022
This fixes a recent regression introduced by the change to use sys.path Fixes python#12956
hauntsaninja
added a commit
that referenced
this issue
Jul 17, 2022
This fixes a recent regression introduced by the change to use sys.path Fixes #12956
hauntsaninja
added a commit
to hauntsaninja/mypy
that referenced
this issue
Jul 17, 2022
This fixes a recent regression introduced by the change to use sys.path Fixes python#12956
ilevkivskyi
pushed a commit
that referenced
this issue
Jul 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new sys.path logic introduced in #11143 carefully avoids putting cwd onto sys.path, which is probably generally a good thing. However, the logic incorrectly removes cwd from sys.path in cases where the current directory has been editably installed (i.e. is on sys.path for reasons unrelated to being the current directory).
I'm not the most familiar with the code, but my understanding is this often doesn't really matter, since cwd should be on
search_paths.python_path
. However, it looks like we only look for stub packages onsearch_paths.package_path
(which is where cwd is now removed from).My concern here isn't theoretical. It came up in #12931 where when trying to reproduce, stubtest was unable to find the django stubs.
Depending on how serious we feel this concern is / how strictly backward compatible we want to be, there are several options for working around this. Curious for your opinions!
cc @AWhetter @ethanhs
The text was updated successfully, but these errors were encountered: