refactor: take pack labels from the name builder

release_pack_labels sliced the version tag off the stem with its own copy of the tag formula; platform_pack_prefix is that value.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:02:28 +01:00
1 parent 87329ca7ee
commit 814f7b6bb9
1 file changed
+2 -7
+2 -7
View File
@@ -102,18 +102,13 @@ def release_pack_labels(root: Path = REPO_ROOT) -> dict[str, str]:
"""
from resolve.grouping import group_identical_platforms
from model.registry import list_release_pack_platforms
from model.platforms import load_platform_config
from packs.naming import file_name_part, platform_pack_stem
from packs.naming import platform_pack_prefix
platforms_dir = str(root / "platforms")
pool = list_release_pack_platforms(platforms_dir)
labels: dict[str, str] = {}
for group, representative in group_identical_platforms(pool, platforms_dir):
stem = platform_pack_stem(group, representative, platforms_dir)
config = load_platform_config(representative, platforms_dir)
version = config.get("version", config.get("dat_version", ""))
tag = f"_{file_name_part(str(version))}" if version else ""
label = stem[: -len(tag)] if tag and stem.endswith(tag) else stem
label = platform_pack_prefix(group, representative, platforms_dir)
for platform in group:
labels[platform] = label
return dict(sorted(labels.items()))