(dist_dir: Path)
| 71 | |
| 72 | |
| 73 | def infer_build_datetime(dist_dir: Path) -> str: |
| 74 | datetimes = { |
| 75 | match.group(1) |
| 76 | for path in dist_dir.iterdir() |
| 77 | if path.is_file() |
| 78 | and path.name.startswith("cpython-") |
| 79 | and (match := BUILD_DATETIME_RE.search(path.name)) is not None |
| 80 | } |
| 81 | |
| 82 | if not datetimes: |
| 83 | raise SystemExit(f"could not infer build datetime from {dist_dir}") |
| 84 | if len(datetimes) != 1: |
| 85 | values = ", ".join(sorted(datetimes)) |
| 86 | raise SystemExit(f"expected one build datetime in {dist_dir}; found: {values}") |
| 87 | |
| 88 | return datetimes.pop() |
| 89 | |
| 90 | |
| 91 | def parse_shasums(shasums_path: Path) -> list[str]: |
no outgoing calls
no test coverage detected