Spaces:
Running
Running
Download core/release/release.py from Alialdlfy1/Teleautoadminbot: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/release/release.py
- Command line
-
hf download hf://spaces/Alialdlfy1/Teleautoadminbot/core/release/release.py
-
curl -L -o release.py https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/release/release.py
1.05 kB
| from __future__ import annotations | |
| import hashlib, json, os, time | |
| from pathlib import Path | |
| class ReleaseManifest: | |
| """Reproducible release manifest without exposing environment secret values.""" | |
| def __init__(self, root="."): | |
| self.root=Path(root) | |
| def build(self, version="29.0", phase="23", output=None): | |
| files=[] | |
| for p in sorted(self.root.rglob("*")): | |
| if not p.is_file() or any(part in {".git","__pycache__","data","backups"} for part in p.parts): continue | |
| if p.name.endswith(".pyc"): continue | |
| h=hashlib.sha256(p.read_bytes()).hexdigest() | |
| files.append({"path":str(p.relative_to(self.root)),"sha256":h,"size":p.stat().st_size}) | |
| doc={"product":"P29","version":version,"phase":str(phase),"generated_at":time.time(),"python_min":"3.10","files":files} | |
| if output: | |
| out=Path(output); out.parent.mkdir(parents=True,exist_ok=True); out.write_text(json.dumps(doc,ensure_ascii=False,indent=2,sort_keys=True),encoding="utf-8") | |
| return doc | |