Run C-API borrowed-ref checker
(self)
| 66 | sys.exit(retcode) |
| 67 | |
| 68 | def run_check_c_api(self) -> tuple[int, str]: |
| 69 | """Run C-API borrowed-ref checker""" |
| 70 | print("Running C API borrow-reference linter...") |
| 71 | borrowed_ref_script = os.path.join( |
| 72 | self.repository_root, "tools", "ci", "check_c_api_usage.py" |
| 73 | ) |
| 74 | borrowed_res = subprocess.run( |
| 75 | [sys.executable, borrowed_ref_script], |
| 76 | cwd=self.repository_root, |
| 77 | stdout=subprocess.PIPE, |
| 78 | stderr=subprocess.STDOUT, |
| 79 | text=True, |
| 80 | check=False, |
| 81 | ) |
| 82 | |
| 83 | # Exit with non-zero if C API Check fails |
| 84 | return borrowed_res.returncode, borrowed_res.stdout |
| 85 | |
| 86 | |
| 87 | if __name__ == "__main__": |