from pathlib import Path import json,hashlib,zipfile,shutil B=Path(__file__).resolve().parents[1]; K=B/'kit' out=B.parents[1]/'outputs/01a1e261-9424-7620-9eb8-641798779213';out.mkdir(parents=True,exist_ok=True) manifest={str(p.relative_to(K/'candidate')):hashlib.sha256(p.read_bytes()).hexdigest() for p in sorted((K/'candidate').rglob('*')) if p.is_file()} (K/'operator/input-manifest.json').write_text(json.dumps(manifest,indent=2)) for name,root in [('candidate-inputs.zip',K/'candidate'),('full-operator-kit.zip',K)]: with zipfile.ZipFile(out/name,'w',zipfile.ZIP_DEFLATED) as z: for p in sorted(root.rglob('*')): if p.is_file():z.write(p,p.relative_to(root)) print(out)