MCPcopy Create free account
hub / github.com/astral-sh/python-build-standalone / find_runner

Function find_runner

ci-matrix.py:345–368  ·  view source on GitHub ↗
(runners: dict[str, Any], platform: str, arch: str, free: bool)

Source from the content-addressed store, hash-verified

343
344
345def 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
371def create_python_build_entry(

Calls

no outgoing calls

Tested by

no test coverage detected