INNER CODE UNIT · Python

write_checksums

zhinkgit/embeddedskills · .github/maintenance/package_release.py:174

def write_checksums(output_directory: Path, archives: list[Path]) -> Path:
    checksum_file = output_directory / "SHA256SUMS"
    lines = [
        f"{hashlib.sha256(path.read_bytes()).hexdigest()}  {path.name}"
        for path in sorted(archives)
    ]
    checksum_file.write_text("\n".join(lines) + "\n", encoding="utf-8", newline="\n")
    return checksum_file


def main() -> int:
    parser = argparse.ArgumentParser(description="Build deterministic release archives")
    parser.add_argument("--root", type=Path, default=repository_root())
    parser.add_argument("--output", type=Path)
    parser.add_argument("--version")
    args = parser.parse_args()

    root = args.root.resolve()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…