-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Explain that mypy should be run in the package root directory #7405
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
Comments
hello @JukkaL can you assign me the issue so that I can start working on this particular issue? |
@Shashankjain12 feel free to just start working on this. |
hello @JelleZijlstra i am new to open source can you suggest me which file to edit in order to prompt users that they are in wrong directory while executing the code? |
@Shashankjain12 You'll probably need to edit |
If I have a package
pkg/
and I run mypy while the current working directory ispkg
, mypy can't resolve imports frompkg
. This is consistent with how Python works (see #7389 for discussion), but it may be surprising for some users. Mypy could detect this issue and generate a note that would tell the user to switch to another directory.More details: If an imported module can't be resolved, but the current working directory contains a
__init__.py[i]
file, see if the import could be resolved if some parent directory was added to the search path. If yes, add a note suggesting that the current working directory should perhaps be changed to a parent directory.The text was updated successfully, but these errors were encountered: