AELYRION-NOULITH-III / scripts /make_manifest.py
PureOne's picture
Add AELYRION-NOULITH III research v3.0.0 (hf.1)
d1c6c9a verified
Raw History Blame Contribute Delete
844 Bytes
#!/usr/bin/env python3
"""Create SHA256SUMS for release files; not a cryptographic authorship signature."""
import hashlib
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
IGNORE_DIRS={'.git','.pytest_cache','__pycache__','.venv','_renders'}
IGNORE_SUFFIX={'.aux','.log','.out','.toc','.fls','.fdb_latexmk','.bbl','.blg','.pyc'}
entries=[]
for path in sorted(ROOT.rglob('*')):
rel=path.relative_to(ROOT)
if not path.is_file() or any(part in IGNORE_DIRS or part.endswith('.egg-info') for part in rel.parts): continue
if path.name in {'SHA256SUMS','main.pdf'} or path.suffix in IGNORE_SUFFIX: continue
entries.append(f'{hashlib.sha256(path.read_bytes()).hexdigest()} {rel.as_posix()}')
(ROOT/'SHA256SUMS').write_text('\n'.join(entries)+'\n',encoding='utf-8')
print(f'Wrote SHA256SUMS for {len(entries)} files.')