MCPcopy Index your code
hub / github.com/python/mypy / error_message_templates

Method error_message_templates

mypy/modulefinder.py:89–115  ·  view source on GitHub ↗
(self, daemon: bool)

Source from the content-addressed store, hash-verified

87 APPROVED_STUBS_NOT_INSTALLED = 3
88
89 def error_message_templates(self, daemon: bool) -> tuple[str, list[str]]:
90 doc_link = "See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports"
91 if self is ModuleNotFoundReason.NOT_FOUND:
92 msg = 'Cannot find implementation or library stub for module named "{module}"'
93 notes = [doc_link]
94 elif self is ModuleNotFoundReason.WRONG_WORKING_DIRECTORY:
95 msg = 'Cannot find implementation or library stub for module named "{module}"'
96 notes = [
97 "You may be running mypy in a subpackage, mypy should be run on the package root"
98 ]
99 elif self is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:
100 msg = (
101 'Skipping analyzing "{module}": module is installed, but missing library stubs '
102 "or py.typed marker"
103 )
104 notes = [doc_link]
105 elif self is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED:
106 msg = 'Library stubs not installed for "{module}"'
107 notes = ['Hint: "python3 -m pip install {stub_dist}"']
108 if not daemon:
109 notes.append(
110 '(or run "mypy --install-types" to install all missing stub packages)'
111 )
112 notes.append(doc_link)
113 else:
114 assert False
115 return msg, notes
116
117
118# If we found the module, returns the path to the module as a str.

Callers 1

module_not_foundFunction · 0.80

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected