from pathlib import Path import hashlib,json,sys root=Path(__file__).resolve().parents[1] entries=json.loads((root/'docs/baseline.json').read_text())['files'] bad=[e['path'] for e in entries if not (root/e['path']).is_file() or hashlib.sha256((root/e['path']).read_bytes()).hexdigest()!=e['sha256']] if bad: print('Baseline changed:', *bad, sep='\n'); sys.exit(1) print('Verified',len(entries),'AVA2 reference files')