"""Fail closed on missing or altered standalone package members.""" from pathlib import Path import hashlib,json root=Path(__file__).resolve().parent;manifest=json.loads((root/'HASHES.json').read_text()) for row in manifest['files']: path=root/row['path'];body=path.read_bytes() if len(body)!=row['bytes'] or hashlib.sha256(body).hexdigest()!=row['sha256']:raise ValueError('Package member changed: '+row['path']) print('PASS',len(manifest['files']),'exact standalone source/recipe/licensed-data members; this is package integrity, not all scientific gates')