refactor: release tools read file_digest

core.hashing.file_digest is the streamed loop the release tools carried,
byte for byte: 1 MiB reads, read again each call. It replaces
compute_hashes with cache=False there.
This commit is contained in:
Abdessamad Derraz committed 2026-11-18 20:44:56 +01:00
1 parent 27bff61560
commit ba692da94f
4 files changed
+11 -9

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ from collections.abc import Callable
from dataclasses import dataclass
from pathlib import Path
from core.hashing import compute_hashes
from core.hashing import file_digest
from model.largefiles import LARGE_FILES_RELEASE, LARGE_FILES_REPO, asset_names, registered_paths
from release.assets import compare, expected_assets, expected_digests, fetch_release
@@ -28,7 +28,7 @@ class Upload:
def sha1_of(path: Path) -> str:
return compute_hashes(path, frozenset({"sha1"}), cache=False)["sha1"]
return file_digest(path)
def database_sha1(db: dict) -> dict[str, str]: