8000 Fine-grained mode doesn't properly respect `--follow-imports` settings when producing error messages · Issue #4798 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fine-grained mode doesn't properly respect --follow-imports settings when producing error messages #4798

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

Closed
msullivan opened this issue Mar 27, 2018 · 1 comment · Fixed by #4840
Assignees
Labels

Comments

@msullivan
Copy link
Collaborator

This test fails:

[case testSkipButDontIgnore]
# cmd: mypy a.py c.py
# flags: --follow-imports=skip
[file a.py]
import b
from c import x
[file b.py]
[file c.py]
x = 1
[file c.py.2]
x = '2'
[out]
==

producing

a.py:1: error: Cannot find module named 'b'
a.py:1: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help)

in the second iteration.
There will be similar problems with incorrect diagnostics with --follow-imports=error.

The root of the problem is that the verify_dependencies function used to produce missing modules messages during incremental updates operates solely in terms of the module graph, but producing the correct diagnostics here requires consulting the file system.

None of this is a problem if you use --ignored-unused-imports, of course.

@msullivan msullivan added bug mypy got something wrong topic-fine-grained-incremental labels Mar 27, 2018
@JukkaL
Copy link
Collaborator
JukkaL commented Mar 27, 2018

Currently we only properly support --follow-imports=skip --ignore-missing-imports in fine-grained mode (I assume that you meant --ignore-missing-imports instead of --ignored-unused-imports).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0