| 75 | |
| 76 | |
| 77 | def 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 | |
| 99 | def main() -> None: |