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

Function write_undocumented_ref_info

mypy/build.py:5139–5157  ·  view source on GitHub ↗
(
    state: State, metastore: MetadataStore, options: Options, type_map: dict[Expression, Type]
)

Source from the content-addressed store, hash-verified

5137
5138
5139def write_undocumented_ref_info(
5140 state: State, metastore: MetadataStore, options: Options, type_map: dict[Expression, Type]
5141) -> None:
5142 # This exports some dependency information in a rather ad-hoc fashion, which
5143 # can be helpful for some tools. This is all highly experimental and could be
5144 # removed at any time.
5145
5146 from mypy.refinfo import get_undocumented_ref_info_json
5147
5148 if not state.tree:
5149 # We need a full AST for this.
5150 return
5151
5152 _, data_file, _ = get_cache_names(state.id, state.xpath, options)
5153 ref_info_file = ".".join(data_file.split(".")[:-2]) + ".refs.json"
5154 assert not ref_info_file.startswith(".")
5155
5156 deps_json = get_undocumented_ref_info_json(state.tree, type_map)
5157 metastore.write(ref_info_file, json_dumps(deps_json))
5158
5159
5160# The IPC message classes and tags for communication with build workers are

Callers 1

finish_passesMethod · 0.85

Calls 7

json_dumpsFunction · 0.90
get_cache_namesFunction · 0.85
splitMethod · 0.80
joinMethod · 0.45
startswithMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…