fix: record a data tree's version beside its cache

This commit is contained in:
Abdessamad Derraz committed 2026-11-24 01:14:04 +01:00
1 parent 8ac5cc348b
commit dfc1860d0d
9 files changed
+105 -58

No files matched your search

+8 -2
View File
@@ -88,10 +88,16 @@ def list_release_pack_platforms(platforms_dir: str = PLATFORMS_DIR) -> list[str]
]
VERSIONS_FILE = "data/.versions.json"
def versions_file_for(entry: dict) -> Path:
"""Where refresh_data_dirs records a tree's last fetch: beside its cache.
The writer and every reader take it from the entry, so a registry whose
caches sit elsewhere than data/ keeps its records with its trees.
"""
return Path(entry["local_cache"]).parent / ".versions.json"
def load_versions(versions_path: str | os.PathLike[str] = VERSIONS_FILE) -> dict[str, dict]:
def load_versions(versions_path: str | os.PathLike[str]) -> dict[str, dict]:
"""What refresh_data_dirs recorded of each tree's last fetch."""
path = Path(versions_path)
if not path.is_file():