chore: check install.py against installer/ in CI

validate.yml and pr_checks.py run build_installer.py --check after the
lint, vermin holds installer/ to 3.8 beside install.py, mypy and ruff
read the package, and both workflows trigger on installer/**.
CONTRIBUTING says where installer changes go.
This commit is contained in:
Abdessamad Derraz committed 2026-11-18 01:37:33 +01:00
1 parent e9f6fe43a0
commit a98e0a7140
6 files changed
+57 -26

No files matched your search

+1
View File
@@ -93,6 +93,7 @@ on:
# The site serves install.sh and install.ps1 pinned to install.py
# of the commit it is built from (scripts/sitebootstrap.py).
- "install.py"
- "installer/**"
- "install.sh"
- "install.ps1"
# The handheld launchers it serves are built from ports/ at the same
+13 -4
View File
@@ -13,8 +13,10 @@ on:
- "scripts/**"
- "tests/**"
# The bootstraps pin install.py's SHA-256 and a test enforces the pin,
# so editing one without the other has to fail the PR.
# so editing one without the other has to fail the PR. install.py is
# built from installer/, and a step fails when the two differ.
- "install.py"
- "installer/**"
- "install.sh"
- "install.ps1"
# The handheld port bundles install.py and its tests read both.
@@ -49,6 +51,7 @@ on:
- "scripts/**"
- "tests/**"
- "install.py"
- "installer/**"
- "install.sh"
- "install.ps1"
- "ports/**"
@@ -187,6 +190,11 @@ jobs:
pip install "ruff==0.17.3"
ruff check --output-format=github .
# install.py is generated from the installer/ package: an edit made to
# one side only fails here.
- name: Check that install.py is the one installer/ builds
run: python scripts/build_installer.py --check
# A profile written from a clone can cite lines that do not hold the value
# it declares, and schemas and tests pass it. Each profile a change adds is
# confronted with its upstream, both roads into main. An edited profile is
@@ -248,7 +256,8 @@ jobs:
# markdown: the site validation test renders a wiki line to prove the
# heading guard's premise, and skipped on every run without it. pyte
# reads the installer's full screen back in its end-to-end tests,
# hypothesis fuzzes its key decoder, and vermin holds install.py to 3.8.
# hypothesis fuzzes its key decoder, and vermin holds install.py and its
# installer/ source to 3.8.
# setuptools reads pyproject.toml for the packaging guard, and uv builds
# the PyPI package the way a release builds it.
- name: Install dependencies
@@ -259,8 +268,8 @@ jobs:
- name: Install the screen tests' dependency for Python 3.8
run: python3.8 -m pip install "pyte==0.8.2"
- name: Hold install.py to Python 3.8
run: vermin --no-tips -t=3.8- --violations install.py
- name: Hold the installer to Python 3.8
run: vermin --no-tips -t=3.8- --violations install.py installer
# The handheld launchers' test runs shellcheck and fails under CI
# without it. The Ubuntu image ships it: this names it if one stops.
+24 -15
View File
@@ -57,6 +57,14 @@ Full walkthrough: [adding a platform](https://abdess.github.io/retrobios/wiki/ad
Full walkthrough: [profiling guide](https://abdess.github.io/retrobios/wiki/profiling/).
## Change the installer
`install.py` is built from the `installer/` package, one module per concern:
edit the module, then run `python scripts/build_installer.py` and
`python scripts/pin_installer.py`. CI fails when `install.py` is not the file
the package builds. [Changing the installer](https://abdess.github.io/retrobios/wiki/installer/#changing-the-installer)
lists what else a change rewrites.
## File conventions
- `bios/Manufacturer/Console/filename` for canonical files
@@ -83,21 +91,22 @@ python scripts/pr_checks.py
does, and names at the end each check that failed or could not run:
```bash
python scripts/validate_pr.py --changed # the BIOS files the branch adds
python scripts/validate_schemas.py --source-only # profiles and platform files
mypy # no type error in install.py and scripts/
ruff check . # the lint rules of pyproject.toml
python scripts/profile_sync.py --added --strict # each profile the branch adds
vermin --no-tips -t=3.8- --violations install.py # install.py stays on Python 3.8
shellcheck --version # the launcher test runs shellcheck
python scripts/export_native.py --all --refresh-cache # files the exporter tests compare with
python scripts/refresh_data_dirs.py # data directories the pack-building tests read
python scripts/generate_site.py # the pages the site tests read
npm ci --prefix website # the site's packages, Node 24
npm run build --prefix website # the built site
python scripts/run_tests.py --jobs 4 # the suite, one process per module
python3.8 -m unittest tests.test_install_tui # the full screen on the installer's floor
python scripts/validate_site.py --site-dir website/dist # links and page budgets
python scripts/validate_pr.py --changed # the BIOS files the branch adds
python scripts/validate_schemas.py --source-only # profiles and platform files
mypy # no type error in install.py, installer/ and scripts/
ruff check . # the lint rules of pyproject.toml
python scripts/build_installer.py --check # install.py is the one installer/ builds
python scripts/profile_sync.py --added --strict # each profile the branch adds
vermin --no-tips -t=3.8- --violations install.py installer # the installer stays on Python 3.8
shellcheck --version # the launcher test runs shellcheck
python scripts/export_native.py --all --refresh-cache # files the exporter tests compare with
python scripts/refresh_data_dirs.py # data directories the pack-building tests read
python scripts/generate_site.py # the pages the site tests read
npm ci --prefix website # the site's packages, Node 24
npm run build --prefix website # the built site
python scripts/run_tests.py --jobs 4 # the suite, one process per module
python3.8 -m unittest tests.test_install_tui # the full screen on the installer's floor
python scripts/validate_site.py --site-dir website/dist # links and page budgets
```
The versions are the ones CI pins. Three tools come from the system, not from
+8 -5
View File
@@ -18,7 +18,7 @@ version = "1.0.0"
description = "BIOS collection manager for retrogaming platforms"
# install.py is the only entry point a user runs before cloning, and both
# bootstraps accept 3.8, so the floor stays where the bootstraps put it. That
# floor covers install.py alone: the build scripts under scripts/ need 3.9
# floor covers install.py and its installer/ source: the build scripts need 3.9
# (common.py, which every build script imports, checks it), and CI runs the
# test suite on 3.12.
requires-python = ">=3.8"
@@ -33,7 +33,7 @@ dev = [
"jsonschema[format-nongpl]>=4.23",
"markdown>=3.7",
# The installer's full-screen tests: pyte reads the screen back,
# hypothesis fuzzes the key decoder, vermin holds install.py to 3.8.
# hypothesis fuzzes the key decoder, vermin holds the installer to 3.8.
"pyte>=0.8.2",
"hypothesis>=6.100",
"vermin>=1.9",
@@ -59,8 +59,10 @@ Repository = "https://github.com/Abdess/retrobios"
# has installed: yaml, jsonschema and the rest read as Any everywhere. The
# code carries no type error and CI fails on any.
[tool.mypy]
files = ["install.py", "scripts"]
# The oldest target mypy 2 checks against. install.py's own floor, 3.8, is
# installer/ is the source of install.py and both are checked: the modules one
# by one, and the file they are joined into, which is the one people run.
files = ["install.py", "installer", "scripts"]
# The oldest target mypy 2 checks against. The installer's own floor, 3.8, is
# held by vermin (pr_checks.py, validate.yml).
python_version = "3.10"
explicit_package_bases = true
@@ -81,7 +83,7 @@ extend-exclude = ["bios", "tmp", "website", ".cache", "dist", "data"]
select = ["E", "F", "W", "B", "C90", "SIM", "PERF", "UP", "RET", "PIE", "PLR09", "PLW1510", "RUF100"]
ignore = [
"E501", # long lines are wrapped by hand where it reads better
"UP006", "UP007", "UP035", "UP045", # install.py keeps 3.8 spellings
"UP006", "UP007", "UP035", "UP045", # the installer keeps 3.8 spellings
"UP036", # the runtime floor guards (sys.version_info < (3, 9)) are the point
"SIM300", # an ALL_CAPS name is not always a constant (_SYSTEM_ROOT)
"SIM108", # a ternary is not always clearer than an if block
@@ -104,5 +106,6 @@ max-returns = 10
[tool.ruff.lint.per-file-ignores]
"install.py" = ["UP"]
"installer/*.py" = ["UP"]
# Shell fixtures inside string literals keep the tabs the real files have.
"tests/test_launchers_*.py" = ["E101"]
+8
View File
@@ -910,6 +910,14 @@ Full walkthrough: [adding a platform]({link("wiki/adding-a-platform")}).
Full walkthrough: [profiling guide]({link("wiki/profiling")}).
## Change the installer
`install.py` is built from the `installer/` package, one module per concern:
edit the module, then run `python scripts/build_installer.py` and
`python scripts/pin_installer.py`. CI fails when `install.py` is not the file
the package builds. [Changing the installer]({link("wiki/installer")}#changing-the-installer)
lists what else a change rewrites.
## File conventions
- `bios/Manufacturer/Console/filename` for canonical files
+3 -2
View File
@@ -40,12 +40,13 @@ class Step:
STEPS: tuple[Step, ...] = (
Step("python scripts/validate_pr.py --changed", "the BIOS files the branch adds"),
Step("python scripts/validate_schemas.py --source-only", "profiles and platform files"),
Step("mypy", "no type error in install.py and scripts/", needs="mypy",
Step("mypy", "no type error in install.py, installer/ and scripts/", needs="mypy",
provider='pip install -e ".[dev]"'),
Step("ruff check .", "the lint rules of pyproject.toml", needs="ruff",
provider='pip install -e ".[dev]"'),
Step("python scripts/build_installer.py --check", "install.py is the one installer/ builds"),
Step("python scripts/profile_sync.py --added --strict", "each profile the branch adds"),
Step("vermin --no-tips -t=3.8- --violations install.py", "install.py stays on Python 3.8",
Step("vermin --no-tips -t=3.8- --violations install.py installer", "the installer stays on Python 3.8",
needs="vermin", provider="the pip line of CONTRIBUTING.md"),
Step("shellcheck --version", "the launcher test runs shellcheck", needs="shellcheck",
provider="the shellcheck package"),