Skip to content

Commit f88e7b0

Browse files
committed
track missing stub packages even when ignore_missing_imports is set
1 parent ef7e8a6 commit f88e7b0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

mypy/build.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,6 +3414,12 @@ def find_module_and_diagnose(
34143414
if caller_state:
34153415
if not (ignore_missing_imports or in_partial_package(id, manager)):
34163416
module_not_found(manager, caller_line, caller_state, id, result)
3417+
elif result is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED:
3418+
# Even when ignoring missing imports, track approved stub packages
3419+
# so that --install-types can still install them.
3420+
dist = stub_distribution_name(id)
3421+
if dist:
3422+
manager.missing_stub_packages.add(dist)
34173423
raise ModuleNotFound
34183424
elif root_source:
34193425
# If we can't find a root source it's always fatal.

0 commit comments

Comments
 (0)