(runners: dict[str, Any], platform: str, arch: str, free: bool)
| 343 | |
| 344 | |
| 345 | def find_runner(runners: dict[str, Any], platform: str, arch: str, free: bool) -> str: |
| 346 | # Find a matching platform first |
| 347 | match_platform = [ |
| 348 | runner |
| 349 | for runner in runners |
| 350 | if runners[runner]["platform"] == platform and runners[runner]["free"] == free |
| 351 | ] |
| 352 | |
| 353 | # Then, find a matching architecture |
| 354 | match_arch = [ |
| 355 | runner for runner in match_platform if runners[runner]["arch"] == arch |
| 356 | ] |
| 357 | |
| 358 | # If there's a matching architecture, use that |
| 359 | if match_arch: |
| 360 | return match_arch[0] |
| 361 | |
| 362 | # Otherwise, use the first with a matching platform |
| 363 | if match_platform: |
| 364 | return match_platform[0] |
| 365 | |
| 366 | raise RuntimeError( |
| 367 | f"No runner found for platform {platform!r} and arch {arch!r} with free={free}" |
| 368 | ) |
| 369 | |
| 370 | |
| 371 | def create_python_build_entry( |
no outgoing calls
no test coverage detected