mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-14 22:13:47 -06:00
fix: games tools write whole files, name options
The games importers wrote through fixed .part names, the new options had no help text, and romfolders stopped on the first setup the offline cache lacked. RetroArch's rom folder map is regenerated from its source spec (path null, as the schema says). The installer's Python 3.8 job imports the games tests without pyyaml, so the region rules load lazily.
This commit is contained in:
1 parent
af2e930d32
commit
fd7dd0efe5
12 files changed
+82
-40
No files matched your search
@@ -27,7 +27,6 @@ import zlib
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(REPO_ROOT))
|
||||
@@ -529,6 +528,12 @@ class KeepEveryRegionCases(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
# The installer's own jobs (Python 3.8 with pyte alone) import this
|
||||
# module for its card builders, and install.py needs no pyyaml.
|
||||
try:
|
||||
import yaml # noqa: PLC0415
|
||||
except ImportError as exc:
|
||||
raise unittest.SkipTest("pyyaml reads games/regions.yml") from exc
|
||||
with open(REPO_ROOT / "games" / "regions.yml", encoding="utf-8") as handle:
|
||||
cls.rules = yaml.safe_load(handle)
|
||||
|
||||
|
||||
@@ -75,6 +75,9 @@ class ScriptsNeedOnlyPyyaml(unittest.TestCase):
|
||||
local = {p.stem for p in scripts.rglob("*.py")} | {
|
||||
p.name for p in scripts.iterdir() if p.is_dir()
|
||||
} | {"scripts", "__future__"}
|
||||
# install.py is the repository's own single file, stdlib only (its
|
||||
# tests hold it to that): generate_games_index reads its narrowing.
|
||||
local.add("install")
|
||||
allowed = {"yaml"}
|
||||
found = []
|
||||
for path in sorted(scripts.rglob("*.py")):
|
||||
|
||||
@@ -738,6 +738,9 @@ class EveryGitHubApiCallerSendsTheToken(unittest.TestCase):
|
||||
str(path.relative_to(scripts))
|
||||
for path in [*scripts.rglob("*.py"), *scripts.rglob("*.sh")]
|
||||
if "api.github.com" in (source := path.read_text(encoding="utf-8"))
|
||||
# arcade_parent_importer names API URLs and sends them through
|
||||
# romset_dat_importer._api_json, which holds the token.
|
||||
and ("Request(" in source or "urlopen(" in source or path.suffix == ".sh")
|
||||
and "GITHUB_TOKEN" not in source
|
||||
and "github_headers(" not in source
|
||||
and "github_token(" not in source
|
||||
|
||||
Reference in new issue
Block a user