You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an __init__.py in the root of my project, and cloned my project into a directory with a dot in its name. When I ran mypy it failed with mypy: can't find module '<module-name>'. I realize that what I was doing was wrong, but it took me cloning mypy and stepping through it with a debugger to understand what was wrong and why it was failing. It would be awesome to have a clearer error message in these cases (eg maybe check that the directories found in the crawl_up method are valid package names and fail if they're not:
To repro, create a directory with a dot in it (eg mkdir tmp.dir), place an empty __init__.py and an empty main.py in it, then run mypy $(pwd)/main.py from within that directory.
Note that this is related to but slightly different from #2773.
The text was updated successfully, but these errors were encountered:
It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an
__init__.py
in the root of my project, and cloned my project into a directory with a dot in its name. When I ran mypy it failed withmypy: can't find module '<module-name>'
. I realize that what I was doing was wrong, but it took me cloning mypy and stepping through it with a debugger to understand what was wrong and why it was failing. It would be awesome to have a clearer error message in these cases (eg maybe check that the directories found in thecrawl_up
method are valid package names and fail if they're not:mypy/mypy/main.py
Line 481 in f1dd3bd
To repro, create a directory with a dot in it (eg
mkdir tmp.dir
), place an empty__init__.py
and an emptymain.py
in it, then runmypy $(pwd)/main.py
from within that directory.Note that this is related to but slightly different from #2773.
The text was updated successfully, but these errors were encountered: