ProCreations's picture
Publish validated ICML reproduction
6c3fe2a verified
Raw
History Blame Contribute Delete
539 Bytes
#!/usr/bin/env python3
import hashlib
from pathlib import Path
r=Path(__file__).resolve().parent;m=r/"BUNDLE_SHA256SUMS.txt";seen=set()
for row in m.read_text(encoding="utf-8").splitlines():
digest,rel=row.split(" ",1);p=r/rel;assert p.is_file() and hashlib.sha256(p.read_bytes()).hexdigest()==digest,rel;seen.add(rel)
actual={p.relative_to(r).as_posix() for p in r.rglob("*") if p.is_file() and p!=m and "__pycache__" not in p.parts and p.suffix!=".pyc"}
assert seen==actual,(seen^actual);print(f"manifest verified: {len(seen)} files")