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

Function record_missing_stub_packages

mypy/build.py:5114–5127  ·  view source on GitHub ↗

Write a file containing missing stub packages. This allows a subsequent "mypy --install-types" run (without other arguments) to install missing stub packages.

(cache_dir: str, missing_stub_packages: set[str])

Source from the content-addressed store, hash-verified

5112
5113
5114def record_missing_stub_packages(cache_dir: str, missing_stub_packages: set[str]) -> None:
5115 """Write a file containing missing stub packages.
5116
5117 This allows a subsequent "mypy --install-types" run (without other arguments)
5118 to install missing stub packages.
5119 """
5120 fnam = missing_stubs_file(cache_dir)
5121 if missing_stub_packages:
5122 with open(fnam, "w") as f:
5123 for pkg in sorted(missing_stub_packages):
5124 f.write(f"{pkg}\n")
5125 else:
5126 if os.path.isfile(fnam):
5127 os.remove(fnam)
5128
5129
5130def is_silent_import_module(manager: BuildManager, path: str) -> bool:

Callers 1

build_innerFunction · 0.85

Calls 5

missing_stubs_fileFunction · 0.85
sortedFunction · 0.85
writeMethod · 0.45
isfileMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…