@@ -57,7 +57,7 @@ class ModuleNotFoundReason(Enum):
57
57
WRONG_WORKING_DIRECTORY = 2
58
58
59
59
# Stub PyPI package (typically types-pkgname) known to exist but not installed.
60
- STUBS_NOT_INSTALLED = 3
60
+ APPROVED_STUBS_NOT_INSTALLED = 3
61
61
62
62
def error_message_templates (self , daemon : bool ) -> Tuple [str , List [str ]]:
63
63
doc_link = "See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports"
@@ -71,7 +71,7 @@ def error_message_templates(self, daemon: bool) -> Tuple[str, List[str]]:
71
71
elif self is ModuleNotFoundReason .FOUND_WITHOUT_TYPE_HINTS :
72
72
msg = 'Skipping analyzing "{module}": found module but no type hints or library stubs'
73
73
notes = [doc_link ]
74
- elif self is ModuleNotFoundReason .STUBS_NOT_INSTALLED :
74
+ elif self is ModuleNotFoundReason .APPROVED_STUBS_NOT_INSTALLED :
75
75
msg = (
76
76
'Library stubs not installed for "{module}" (or incompatible with Python {pyver})'
77
77
)
@@ -231,7 +231,7 @@ def _find_module_non_stub_helper(self, components: List[str],
231
231
or self .fscache .isfile (dir_path + ".py" )):
232
232
plausible_match = True
233
233
if components [0 ] in legacy_bundled_packages :
234
- return ModuleNotFoundReason .STUBS_NOT_INSTALLED
234
+ return ModuleNotFoundReason .APPROVED_STUBS_NOT_INSTALLED
235
235
elif plausible_match :
236
236
return ModuleNotFoundReason .FOUND_WITHOUT_TYPE_HINTS
237
237
else :
@@ -311,7 +311,7 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
311
311
if isinstance (non_stub_match , ModuleNotFoundReason ):
312
312
if non_stub_match is ModuleNotFoundReason .FOUND_WITHOUT_TYPE_HINTS :
313
313
found_possible_third_party_missing_type_hints = True
314
- elif non_stub_match is ModuleNotFoundReason .STUBS_NOT_INSTALLED :
314
+ elif non_stub_match is ModuleNotFoundReason .APPROVED_STUBS_NOT_INSTALLED :
315
315
need_installed_stubs = True
316
316
else :
317
317
third_party_inline_dirs .append (non_stub_match )
@@ -413,7 +413,7 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
413
413
return ancestor
414
414
415
415
if need_installed_stubs :
416
- return ModuleNotFoundReason .STUBS_NOT_INSTALLED
416
+ return ModuleNotFoundReason .APPROVED_STUBS_NOT_INSTALLED
417
417
elif found_possible_third_party_missing_type_hints :
418
418
return ModuleNotFoundReason .FOUND_WITHOUT_TYPE_HINTS
419
419
else :
0 commit comments