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

Function build_mypy

misc/perf_compare.py:40–59  ·  view source on GitHub ↗
(
    target_dir: str,
    multi_file: bool,
    *,
    cflags: str | None = None,
    log_trace: bool = False,
    opt_level: str = "2",
)

Source from the content-addressed store, hash-verified

38
39
40def build_mypy(
41 target_dir: str,
42 multi_file: bool,
43 *,
44 cflags: str | None = None,
45 log_trace: bool = False,
46 opt_level: str = "2",
47) -> None:
48 env = os.environ.copy()
49 env["CC"] = "clang"
50 env["MYPYC_OPT_LEVEL"] = opt_level
51 env["PYTHONHASHSEED"] = "1"
52 if multi_file:
53 env["MYPYC_MULTI_FILE"] = "1"
54 if log_trace:
55 env["MYPYC_LOG_TRACE"] = "1"
56 if cflags is not None:
57 env["CFLAGS"] = cflags
58 cmd = [sys.executable, "setup.py", "--use-mypyc", "build_ext", "--inplace"]
59 subprocess.run(cmd, env=env, check=True, cwd=target_dir)
60
61
62def clone(target_dir: str, commit: str | None, repo_source: str | None = None) -> None:

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls 2

copyMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…