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

Class SccRequestMessage

mypy/build.py:5188–5240  ·  view source on GitHub ↗

A message representing a request to type check a batch of SCCs. If scc_ids is empty, then it means that the coordinator requested a shutdown.

Source from the content-addressed store, hash-verified

5186
5187
5188class SccRequestMessage(IPCMessage):
5189 """
5190 A message representing a request to type check a batch of SCCs.
5191
5192 If scc_ids is empty, then it means that the coordinator requested a shutdown.
5193 """
5194
5195 def __init__(
5196 self,
5197 *,
5198 scc_ids: list[int],
5199 import_errors: dict[str, list[ErrorInfo]],
5200 mod_data: dict[str, tuple[bytes, FileRawData | None]],
5201 ) -> None:
5202 self.scc_ids = scc_ids
5203 self.import_errors = import_errors
5204 self.mod_data = mod_data
5205
5206 @classmethod
5207 def read(cls, buf: ReadBuffer) -> SccRequestMessage:
5208 return SccRequestMessage(
5209 scc_ids=read_int_list(buf),
5210 import_errors={
5211 read_str(buf): [ErrorInfo.read(buf) for _ in range(read_int_bare(buf))]
5212 for _ in range(read_int_bare(buf))
5213 },
5214 mod_data={
5215 read_str_bare(buf): (
5216 read_bytes(buf),
5217 FileRawData.read(buf) if read_bool(buf) else None,
5218 )
5219 for _ in range(read_int_bare(buf))
5220 },
5221 )
5222
5223 def write(self, buf: WriteBuffer) -> None:
5224 write_tag(buf, SCC_REQUEST_MESSAGE)
5225 write_int_list(buf, self.scc_ids)
5226 write_int_bare(buf, len(self.import_errors))
5227 for path, errors in self.import_errors.items():
5228 write_str(buf, path)
5229 write_int_bare(buf, len(errors))
5230 for error in errors:
5231 error.write(buf)
5232 write_int_bare(buf, len(self.mod_data))
5233 for mod, (suppressed_deps_opts, raw_data) in self.mod_data.items():
5234 write_str_bare(buf, mod)
5235 write_bytes(buf, suppressed_deps_opts)
5236 if raw_data is None:
5237 write_bool(buf, False)
5238 else:
5239 write_bool(buf, True)
5240 raw_data.write(buf)
5241
5242
5243class ModuleResult:

Callers 3

buildFunction · 0.85
submit_to_workersMethod · 0.85
readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…