(path: str)
| 144 | |
| 145 | |
| 146 | def sort_order(path: str) -> tuple[int, str]: |
| 147 | if "include/numpy" in path: |
| 148 | # Want to process numpy/*.h first, to work out which of those |
| 149 | # include Python.h directly |
| 150 | priority = 0x00 |
| 151 | elif "h" in os.path.splitext(path)[1].lower(): |
| 152 | # Then other headers, which tend to include numpy/*.h |
| 153 | priority = 0x10 |
| 154 | else: |
| 155 | # Source files after headers, to give the best chance of |
| 156 | # properly checking whether they include Python.h |
| 157 | priority = 0x20 |
| 158 | if "common" in path: |
| 159 | priority -= 8 |
| 160 | path_basename = os.path.basename(path) |
| 161 | if path_basename.startswith("npy_"): |
| 162 | priority -= 4 |
| 163 | elif path_basename.startswith("npy"): |
| 164 | priority -= 3 |
| 165 | elif path_basename.startswith("np"): |
| 166 | priority -= 2 |
| 167 | if "config" in path_basename: |
| 168 | priority -= 1 |
| 169 | return priority, path |
| 170 | |
| 171 | |
| 172 | def process_files(file_list: list[str]) -> int: |
nothing calls this directly
no test coverage detected
searching dependent graphs…