Commit Graph
9 Commits
Author SHA1 Message Date
Abdessamad Derraz 0b0bf29089 fix: say why an unreadable board list stops a pack 2026-11-21 19:50:47 +01:00
Abdessamad Derraz 98775b7e4d refactor: share the loopback server of the tests
Each installer test module rebuilt the same loopback fixture: a silent SimpleHTTPRequestHandler, a ThreadingHTTPServer on a daemon thread with its two cleanups, closed_port(), noise() and the CRC-32 text. tests/loopback.py holds them once; handlers with their own behaviour (Slow, Range, Held) pass in as handler=. The test_install servers that set log_message on a functools.partial, which never reached the handler, now use the quiet one. The journeys comment says why their root stays in tmp/.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz fbbb941e38 refactor: one owner for the test scratch folder
Test modules passed dir= the repository's tmp/ or a hard-coded tmp/tests by hand, and seven modules kept their own _tempdir copy. Under run_tests.py the literal tmp/tests did not exist in a fresh clone (FileNotFoundError in test_core_probe and scratch_checkout), and dir=tmp/ wrote beside the per-module scratch folders. Every temporary directory now lands in the folder tests/__init__ sets, and scratch_dir() replaces the copies. The X socket binds by a relative name, since a scratch path can exceed the 108-byte AF_UNIX limit. The journeys keep the short tmp/ root: their word budgets count the printed card path.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz b338d94fa0 fix: record no narrowing axis for an older list
A list with cores and neither systems nor regions is from an older
release, and recorded_axes reads none from it. A pack built here or by
generate_pack wrote cores and regions in its manifest. The installer
pack now asks recorded_axes, and the builder follows the same rule.
2026-11-21 06:04:39 +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 cc028fe7ee chore: clear the ruff findings in tests 2026-11-17 07:21:28 +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 ba2df77698 fix: swap a pack in whole and name its platform
The earlier pack of the name is set aside while the new files take their names and put back if one cannot, so the folder never holds a mix of parts. A scratch file that cannot be deleted is named, and a cleanup that fails keeps a written pack at exit 0. Only a file whose marker or manifest names the pack is removed, each one said. Each member is deflated at level 9 and the ZIP is read back with testzip. The space check counts the largest data tree archive. A pack name that spells another platform is refused, and the reader trusts the platform the manifest names.
2026-11-11 18:06:16 +01:00
Abdessamad Derraz 92462effc6 feat: make a pack from the installer
--pack downloads the narrowed choice into a pack ZIP laid out as --from-pack reads it, the list narrowed to the choice inside. Every member is checked against its SHA-1 before the ZIP is closed, and a failure leaves no file behind. --split writes parts that are each a whole ZIP, and a pack past 4 GB on a FAT32 drive is split by itself. More on the plan holds Make a pack, its plan and its result. Event pack.
2026-11-11 17:17:42 +01:00