fix: read the platform guides on first use

model.guides read and checked _registry.yml and _guides.yml at import,
from the repository: a pack build died on a registry entry without a guide
before parsing its options, and a site run on another platforms folder
took the repository's guides. The guides now load on first use, keyed on
siteinputs.current().platforms, behind accessor functions.
This commit is contained in:
Abdessamad Derraz committed 2026-11-23 21:02:46 +01:00
1 parent 9f987adb8c
commit e8b3cef5d5
31 files changed
+290 -204

No files matched your search

+5 -5
View File
@@ -116,15 +116,15 @@ class TheOneLinerFollowsTheRegistry(unittest.TestCase):
def test_the_commands_are_written_once(self):
"""The address comes from install_base in platforms/_guides.yml, the
one the site's commands use."""
from packs import readme as packreadme
from model import guides
from model.guides import INSTALL_BASE
from model.guides import install_ps1, install_sh
source = (REPO_ROOT / "scripts" / "packs" / "readme.py").read_text(encoding="utf-8")
self.assertNotIn("raw.githubusercontent.com", source)
self.assertNotIn("abdess.github.io", source)
self.assertEqual(packreadme.INSTALL_SH, f"{INSTALL_BASE}/{guides.SH_NAME}")
self.assertEqual(packreadme.INSTALL_PS1, f"{INSTALL_BASE}/{guides.PS1_NAME}")
text = build_readme("retroarch", "RetroArch", "system", 1, 1,
detect=[{"os": "linux"}, {"os": "windows"}])
self.assertIn(install_sh(), text)
self.assertIn(install_ps1(), text)
class GuidesInstallFromTheZipInHand(unittest.TestCase):