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

Function infer_build_datetime

pythonbuild/mirror.py:73–88  ·  view source on GitHub ↗
(dist_dir: Path)

Source from the content-addressed store, hash-verified

71
72
73def 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
91def parse_shasums(shasums_path: Path) -> list[str]:

Callers 1

build_upload_entriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected