MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / write_manifests

Function write_manifests

scripts/finalize_windows_dist.py:208–240  ·  view source on GitHub ↗
(staging: Path, portable_zip: Path, msi: Path)

Source from the content-addressed store, hash-verified

206
207
208def write_manifests(staging: Path, portable_zip: Path, msi: Path) -> None:
209 print(f"Hashing {portable_zip.name}...")
210 portable_digest = sha256_file(portable_zip)
211 print(f"Hashing {msi.name}...")
212 msi_digest = sha256_file(msi)
213
214 manifest = {
215 "version": VERSION,
216 "generated_at": datetime.now(timezone.utc).isoformat(timespec="seconds"),
217 "bundles": {
218 "msi": {
219 "path": msi.name,
220 "size": msi.stat().st_size,
221 "sha256": msi_digest,
222 },
223 "portable_zip": {
224 "path": portable_zip.name,
225 "size": portable_zip.stat().st_size,
226 "sha256": portable_digest,
227 "contents": hash_zip_contents(portable_zip),
228 },
229 },
230 }
231
232 manifest_path = staging / f"PySceneDetect-{VERSION}-win64.manifest.json"
233 sums_path = staging / "SHA256SUMS"
234 manifest_path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
235 sums_path.write_text(
236 f"{msi_digest} {msi.name}\n{portable_digest} {portable_zip.name}\n",
237 encoding="utf-8",
238 )
239 print(f"Wrote {manifest_path.name}")
240 print(f"Wrote {sums_path.name}")
241
242
243def main() -> None:

Callers 1

mainFunction · 0.85

Calls 2

sha256_fileFunction · 0.85
hash_zip_contentsFunction · 0.85

Tested by

no test coverage detected