MCPcopy
hub / github.com/python/mypy / build

Method build

mypy/test/testdiff.py:56–70  ·  view source on GitHub ↗
(self, source: str, options: Options)

Source from the content-addressed store, hash-verified

54 )
55
56 def build(self, source: str, options: Options) -> tuple[list[str], dict[str, MypyFile] | None]:
57 options.use_builtins_fixtures = True
58 options.show_traceback = True
59 options.cache_dir = os.devnull
60 options.allow_empty_bodies = True
61 try:
62 result = build.build(
63 sources=[BuildSource("main", None, source)],
64 options=options,
65 alt_lib_path=test_temp_dir,
66 )
67 except CompileError as e:
68 # TODO: Is it okay to return None?
69 return e.messages, None
70 return result.errors, result.files

Callers 15

run_caseMethod · 0.95
build_stubsFunction · 0.45
run_buildFunction · 0.45
test_semanalFunction · 0.45
test_semanal_errorFunction · 0.45
run_caseMethod · 0.45
run_caseMethod · 0.45
test_error_streamFunction · 0.45
run_caseMethod · 0.45
run_caseMethod · 0.45
test_transformFunction · 0.45

Calls 1

BuildSourceClass · 0.90

Tested by

no test coverage detected