Errors related to imports different in fine-grained incremental mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the test cases in test-data/unit/fine-grained-modules.test, especially testDeletionOfSubmoduleTriggersImportFrom1 and testDeleteTwoFilesErrorsElsewhere, and compare their incremental and non-incremental output. Done means redundant import-related errors are removed, the preferred missing-module message is consistent, and error line numbers match across modes.
Written by the indexing model from the issue text.
Description
The example from test-data/unit/fine-grained-modules.test illustrates a problem with inconsistent import-related messages:
[case testDeletionOfSubmoduleTriggersImportFrom1]
from p import q
[file p/__init__.py]
[file p/q.py]
[delete p/q.py.2]
[file p/q.py.3]
[out]
==
main:1: error: Cannot find module named 'p.q'
-- TODO: The following messages are different compared to non-incremental mode
main:1: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help)
main:1: error: Module 'p' has no attribute 'q'
==
The expected behavior is to show only one of Cannot find module named 'p.q' / Module 'p' has no attribute 'q' (preferably the first alternative) in all modes.
Another test case which illustrates the problem:
[case testDeleteTwoFilesErrorsElsewhere]
import a
import b
a.f()
b.g()
[file a.py]
def f() -> None: pass
[file b.py]
def g() -> None: pass
[delete a.py.2]
[delete b.py.2]
[out]
==
main:1: error: Cannot find module named 'a'
main:1: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help)
-- TODO: Remove redundant error message
main:1: error: Cannot find module named 'b'
main:2: error: Cannot find module named 'b'
We should also make sure that error line numbers are consistent.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/mypy
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug topic-configuration topic-error-reporting
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100