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

Function check_requirements

misc/profile_check.py:77–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75
76
77def check_requirements() -> None:
78 if sys.platform != "linux":
79 # TODO: How to make this work on other platforms?
80 sys.exit("error: Only Linux is supported")
81 else: # fun fact/todo: we have to use else here, because of https://github.com/python/mypy/issues/10773
82 try:
83 subprocess.run(["perf", "-h"], capture_output=True)
84 except (subprocess.CalledProcessError, FileNotFoundError):
85 print("error: The 'perf' profiler is not installed")
86 sys.exit(1)
87
88 try:
89 subprocess.run(["clang", "--version"], capture_output=True)
90 except (subprocess.CalledProcessError, FileNotFoundError):
91 print("error: The clang compiler is not installed")
92 sys.exit(1)
93
94 if not os.path.isfile("mypy_self_check.ini"):
95 print("error: Run this in the mypy repository root")
96 sys.exit(1)
97
98
99def main() -> None:

Callers 1

mainFunction · 0.85

Calls 4

printFunction · 0.85
exitMethod · 0.80
runMethod · 0.45
isfileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…