Reputation: 21
mypy seems to be ignoring at least some errors when called on a file using an absolute address. I had originally presumed this was an issue with my project but it's very easy for me to reproduce on a basic setup. If you have reason to believe this an issue with my machine setup, I would love to know - I'm currently unable to use mypy linting in vscode due to this issue.
$ .venv/bin/mypy --strict /home/mike/Documents/deleteMe/pipenv_testing/sample.py
Success: no issues found in 1 source file
$ .venv/bin/mypy --strict ./sample.py
sample.py:4: error: Function is missing a type annotation [no-untyped-def]
Found 1 error in 1 file (checked 1 source file)
To Reproduce
def do_a_thing(invar):
return invar + 1
pipenv install mypy
).venv/bin/mypy --strict ./sample.py
.venv/bin/mypy --strict /home/mike/Documents/deleteMe/pipenv_testing/sample.py
Expected Behavior It's expected that both conditions should yield identical error results rather than the absolute path call yielding no issues/errors.
My Environment
Upvotes: 0
Views: 718
Reputation: 21
Leaving this up in case it helps anyone else but this is an issue with ~0.990 versions of mypy that is now resolved in the master branch with a patch coming out shortly.
Github issue: https://github.com/python/mypy/issues/14080
Upvotes: 1