Commit Graph
2991 Commits
Author SHA1 Message Date
Abdessamad Derraz f48b66b540 refactor: keep split packs beside platformpack 2026-11-18 13:47:31 +01:00
Abdessamad Derraz 0b532366d0 refactor: move pack library code into packs/ 2026-11-18 13:47:31 +01:00
Abdessamad Derraz 18e91f8c07 refactor: read the repo root from core.paths 2026-11-18 13:46:15 +01:00
Abdessamad Derraz 92903eb4be refactor: split the C# reader from RetroBat's 2026-11-18 13:38:44 +01:00
Abdessamad Derraz 738bb5bc07 refactor: share the target scrapers' fetch and CLI 2026-11-18 13:38:44 +01:00
Abdessamad Derraz 6f8b8dedb2 refactor: share the scrapers' fetch helpers 2026-11-18 13:38:44 +01:00
Abdessamad Derraz a5834a4b8a refactor: move the export library into exporter 2026-11-18 13:38:44 +01:00
Abdessamad Derraz 8738179f42 refactor: move the region audit library down 2026-11-18 13:38:44 +01:00
Abdessamad Derraz a81c497e8d refactor: break the scraper import cycles 2026-11-18 13:38:34 +01:00
Abdessamad Derraz 2b3551dd22 fix: keep a write pass going on a cold cache
--rebase-refs or --bump-commit with --offline read the prose of a
profile whose cited files were never cached, and the NotCachedError
ended the whole pass on a traceback. The profile is named, counted
as failed and left as it was, and the pass goes on.
2026-11-18 12:50:24 +01:00
Abdessamad Derraz 735f86283b refactor: split profile_sync into profiling
profile_sync.py keeps the command line: the parser, the flag checks,
profile selection against the branch, main, and the two steps that
read top-level modules (project_base, the site's source paths). The
library goes to one module per concern under scripts/profiling.

Tests that patched a name now patch the module their caller reads
it from. test_layers declares profiling with no sibling imports.
2026-11-18 12:49:20 +01:00
Abdessamad Derraz eea24c68ca refactor: read sourceref names from their module
profile_sync re-exported the source_ref grammar for its callers and
tests. Each of them imports it from model.sourceref now, and
profile_sync keeps a plain import of what it uses.
2026-11-18 12:41:16 +01:00
Abdessamad Derraz e1f2f8685d refactor: move upstream, sourceref, version_basis
upstream reads forges with the standard library alone and scrapers,
packs and the site read it: it goes to core. sourceref is the grammar
of a profile field, which the site parses without the comparison
tool: it goes to model. version_basis is read by profile_sync alone
and opens the profiling package.
2026-11-18 12:39:09 +01:00
Abdessamad Derraz ba94437558 feat: hold the import layers of scripts/
core (0) imports the standard library only, model (1) loads data,
resolve (2) turns declarations into files, the domain packages (3)
build on them and the top-level scripts are the commands (4). The test
refuses an import into a higher layer, a cycle between packages or
inside core, model and resolve, and a package module importing a
top-level module. NOT_YET_PACKAGED and PENDING_TOP_LEVEL_IMPORTS list
what later waves move, exactly, so an emptied entry has to leave.
2026-11-18 11:40:15 +01:00
Abdessamad Derraz c764d9abf1 refactor: split the leaf modules libraries use
model.region holds the region vocabulary, resolve.regions the selection
that needs the cores a platform runs. The libraries behind identity.py,
retired_files.py and torrentzip.py move to resolve.identity,
model.retired and core.torrentzip, with their long docstrings; the
commands stay where they are run from. The source_ref parts that cite a
config or feature file move from scraper.shell_launchers to
resolve.launcherrefs, so resolve no longer imports the scraper package.
2026-11-18 11:39:47 +01:00
Abdessamad Derraz 83cfa6fd0f refactor: split common.py into three packages
core: cli (run_cli, input errors, name hints), github (token), paths.
model: sources, database, composition, registry, platforms,
declarations, targets, systems, profiles, cliargs. resolve: content,
ownership, datadirs, archives, localfile, directories, layout,
contentlayout, standalone, grouping, cores.

Definitions move verbatim; common.py and its re-exports are gone and
every importer, patch target and code-in-string names the new home. A
test that stubbed common.load_platform_config stubs each module that
reads the loader by its own name.
2026-11-18 11:09:13 +01:00
Abdessamad Derraz c784aef883 refactor: move leaf modules into packages
core: hashing, artifacts, ziptools, deterministic_zip, romdir, sect233r1,
crypto_verify, paths (REPO_ROOT). model: safeparse (needs yaml),
dumpcatalog, largefiles, alternatives. resolve: nativemode, validation,
launchers, slot, truth, gamedata, and exporter/baseline.py and
exporter/candidates.py as resolve/reconcile.py and resolve/categories.py,
which truth and gamedata read.

Every importer follows. Modules one level deeper read the repository
root from core.paths instead of __file__.
2026-11-18 10:50:45 +01:00
Abdessamad Derraz 23d8a770f1 docs: map the installer modules by concern
wiki/architecture.md groups the modules of installer/, and a test holds the table to the package and each module to a one-line docstring.
2026-11-18 02:55:56 +01:00
Abdessamad Derraz e9f6fe43a0 refactor: split the installer into a package
install.py held 31,575 lines and 1,370 definitions in one module. Its
source is now installer/, 45 modules by concern, each importing from the
others what it uses, so ruff and mypy read every module on its own.

scripts/build_installer.py joins them back into install.py in import
order, with one block of standard library imports and the zlib and
unicodedata guard. It refuses an import from outside the standard
library, a name two modules define, an import cycle, a renamed import
and an import-time read of a name from a later module. install.py stays
one stdlib-only file for the bootstraps, the launchers and PyPI.

The split was written by a script, statement by statement: every
top-level statement of the old file is in the new one with the same AST.
Two tests that located code by its neighbour now read it by name.
2026-11-18 01:37:28 +01:00
Abdessamad Derraz f75b87448e chore: weigh the astro 7.4.12 generator meta
Astro 7.4.12 writes its version in the generator meta of every page,
one byte longer than 7.4.4. AmberELEC ran 2 bytes over its budget on
Validation of 55e7616eb; each budget is now the size of its pages on
the site deployed from that commit.
2026-11-17 20:41:10 +01:00
Abdessamad Derraz 7895edd582 chore: drop type ignores mypy never reads 2026-11-17 16:44:35 +01:00
Abdessamad Derraz 14002da6b6 chore: merge the test suite noqa cleanup 2026-11-17 16:14:49 +01:00
Abdessamad Derraz 5f18caec31 refactor: put scripts/ on the test path once
tests/__init__ now puts the repository root and scripts/ on sys.path,
so no test module inserts them and every import sits in the import
block. ruff accepts the bare `import tests` the modules keep for its
side effects. The last suppressions go: helper test modules import as
tests.<name>, files open in with blocks, lambdas become functions.
2026-11-17 16:11:23 +01:00
Abdessamad Derraz aded24dbcc fix: read the split installer shapes in two tests 2026-11-17 15:44:44 +01:00
Abdessamad Derraz 8f1b88bb7e chore: lint with ruff in CI, drop mypy baseline
The code now carries no type error and no ruff finding. CI runs mypy
bare and ruff with the rule set of pyproject.toml; pr_checks.py and
the contribution guide list both. The baseline and its tooling go.
2026-11-17 15:28:11 +01:00
Abdessamad Derraz 0d0ec442b3 chore: merge the installer quality work 2026-11-17 15:11:43 +01:00
Abdessamad Derraz 188f9393a3 refactor: group outcome, check and menu arguments 2026-11-17 14:02:33 +01:00
Abdessamad Derraz e14a7d79bb chore: merge the verify and truth quality work 2026-11-17 09:48:56 +01:00
Abdessamad Derraz 81a94fc267 refactor: make writable an instance method 2026-11-17 09:48:13 +01:00
Abdessamad Derraz ec3a6ab8af refactor: render pages from a PageMeta in tests 2026-11-17 09:34:59 +01:00
Abdessamad Derraz 1acfd8b812 feat: let type-checking imports pass the deps test 2026-11-17 08:25:40 +01:00
Abdessamad Derraz ddcbbe5c0b refactor: pass zip_contents by name in a test 2026-11-17 07:33:19 +01:00
Abdessamad Derraz cc028fe7ee chore: clear the ruff findings in tests 2026-11-17 07:21:28 +01:00
Abdessamad Derraz 382241fb1b refactor: split long test functions by stage 2026-11-17 07:21:12 +01:00
Abdessamad Derraz 896416b333 refactor: name generate_pack arguments in tests 2026-11-17 07:21:12 +01:00
Abdessamad Derraz 4e9f7673a2 chore: merge main for the ruff config 2026-11-17 07:09:56 +01:00
Abdessamad Derraz 3e732fd57e chore: merge origin main into the lint work 2026-11-17 07:09:55 +01:00
Abdessamad Derraz 4eacb6ff39 chore: lint scripts and tests with ruff
pyproject.toml now carries the ruff rule set: pyflakes, the B rules,
simplify, perf, pyupgrade, complexity and size limits. This commit
applies the fixes that change no behavior and the small defects the
first run named:

- tests/test_install.py used argparse without importing it
- three loops rebound the outer `profile` with each layout
  (packextras, slots, verify); the loop variable is now `layout`
- profile_sync loops shadowed dataclasses.field
- generate_readme and packextras computed values nothing read
- stale noqa markers for rules the project does not enforce

Complexity, size and the remaining findings are handled next.
2026-11-17 07:07:48 +01:00
Abdessamad Derraz ac37802e20 feat: keep game data out of the wanted list
Game data is the player's own, and a file the emulator installs for the build that reads it is no gap: neither is listed. A platform entry leaves when every core reading it installs it (validation.deliverable, scoped by the platform's build of each core).
2026-11-17 03:14:42 +01:00
Abdessamad Derraz b1e8de7124 feat: show the wanted list as a plain table
File name, size, CRC32, MD5 and SHA1, a header row per system, firmware and required first, filtered by name or hash. Each name links its emulator card, else its setup page. Rows carry no upload button: the drop box does that. wanted.json keeps only what the table and the drop box read.
2026-11-13 19:54:20 +01:00
Abdessamad Derraz 6ce6469d25 feat: rank unread platform files after firmware
A file a platform lists and no core it runs reads (verify's unread category) comes after firmware and before game data, labelled on its row.
2026-11-13 19:00:17 +01:00
Abdessamad Derraz 8ae4cb61ac chore: merge main into the wanted page work 2026-11-13 18:34:26 +01:00
Abdessamad Derraz b3a5109955 fix: place hashless files by their own system
The wanted list puts firmware first, then game data, labels each row, and leaves out what no one can share (the profile's reason: user written, emulator written, per person). validate_pr.placement() takes a file known by name alone to its system's folder or the directory it declares, never beside a homonym held for another system.
2026-11-13 18:34:13 +01:00
Abdessamad Derraz 3fd61df038 feat: list every wanted file with its upload
The wanted page lists every file the gaps report lacks, hashless ones included and marked, by system and most useful first, each with its own upload button to the folder validate_pr.placement() gives. Steps from a file in hand to its merge, copy without personal pronouns, list address versioned against stale caches.
2026-11-13 17:38:34 +01:00
Abdessamad Derraz 9362816363 chore: weigh the header wanted link per page
The Wanted files link in the header of every page adds about 80 bytes a
page. Batocera, AmberELEC, RomM and RetroArch ran over their byte
budget on Validation of aada55e65; each budget is now the size of its
pages on the site deployed from that commit.
2026-11-13 17:34:53 +01:00
Abdessamad Derraz c4f746e2d5 chore: merge the wanted files page 2026-11-13 12:26:49 +01:00
Abdessamad Derraz e6738e591b feat: put the wanted page in the site header
A Wanted files link sits in the bar on every page and every width, beside the search and menu buttons on a phone, current on its own page. Below 27rem the site name is kept for screen readers only. files/ and wanted/ link each other in one line.
2026-11-13 12:26:18 +01:00
Abdessamad Derraz 4a9317cb4c feat: add the wanted page
Files dropped on wanted/ are hashed in the browser and compared with the files the gaps page reports the collection lacks. A wanted file gets a link to GitHub's upload page for the folder validate_pr asks for, and the name to give it. The gaps page upload link reads the same rule.
2026-11-13 10:45:18 +01:00
Abdessamad Derraz d685451f44 refactor: hash a file in slices in one module
MD5 and CRC32 take the file piece by piece, so a large file keeps the page responsive. The lookup and the wanted page read the same code, checked against hashlib and zlib.
2026-11-13 10:45:12 +01:00
Abdessamad Derraz b18e478db0 refactor: share the placement rule of validate_pr
placement() decides the folder and name of a file not under bios/ yet, so the wanted page and the gaps page send an upload where the review asks for it. A declared file whose name the collection holds now gets the .variants/ slot beside it.
2026-11-13 10:45:12 +01:00