mirror of
https://github.com/Abdess/retrobios.git
synced 2026-06-21 19:12:48 +00:00
refactor: consolidate CI pipeline, remove third-party deps
This commit is contained in:
parent
e6ea0484a8
commit
3453f89d9d
34 changed files with 206 additions and 2091 deletions
|
|
@ -24,7 +24,7 @@ import zipfile
|
|||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
from common import load_platform_config
|
||||
from common import load_database, load_platform_config
|
||||
|
||||
try:
|
||||
import yaml
|
||||
|
|
@ -40,11 +40,6 @@ LARGE_FILES_RELEASE = "large-files"
|
|||
LARGE_FILES_REPO = "Abdess/retrobios"
|
||||
|
||||
|
||||
def load_database(db_path: str) -> dict:
|
||||
with open(db_path) as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def fetch_large_file(name: str, dest_dir: str = ".cache/large") -> str | None:
|
||||
"""Download a large file from the 'large-files' GitHub release if not cached."""
|
||||
cached = os.path.join(dest_dir, name)
|
||||
|
|
@ -380,9 +375,7 @@ def main():
|
|||
if new_path != zip_path:
|
||||
os.rename(zip_path, new_path)
|
||||
print(f" Renamed -> {os.path.basename(new_path)}")
|
||||
except FileNotFoundError as e:
|
||||
print(f" ERROR: {e}")
|
||||
except Exception as e:
|
||||
except (FileNotFoundError, OSError, yaml.YAMLError) as e:
|
||||
print(f" ERROR: {e}")
|
||||
|
||||
|
||||
|
|
@ -392,8 +385,6 @@ def _group_identical_platforms(platforms: list[str], platforms_dir: str) -> list
|
|||
Returns [(group_of_platform_names, representative_platform), ...].
|
||||
Platforms with the same resolved systems+files+base_destination are grouped.
|
||||
"""
|
||||
import hashlib as _hl
|
||||
|
||||
fingerprints = {}
|
||||
representatives = {}
|
||||
|
||||
|
|
@ -413,7 +404,7 @@ def _group_identical_platforms(platforms: list[str], platforms_dir: str) -> list
|
|||
full_dest = f"{base_dest}/{dest}" if base_dest else dest
|
||||
entries.append(full_dest)
|
||||
|
||||
fingerprint = _hl.sha1("|".join(sorted(entries)).encode()).hexdigest()
|
||||
fingerprint = hashlib.sha1("|".join(sorted(entries)).encode()).hexdigest()
|
||||
fingerprints.setdefault(fingerprint, []).append(platform)
|
||||
representatives.setdefault(fingerprint, platform)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue