From cb17145665ab6345e2104edeab0951be9dbc6f2f Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 03:32:26 +0100 Subject: [PATCH] fix: install setuptools for the packaging guard --- .github/workflows/validate.yml | 3 ++- CONTRIBUTING.md | 2 +- pyproject.toml | 4 ++++ scripts/generate_readme.py | 2 +- tests/test_audit_regressions.py | 4 ++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index eca666728..c1e18a9e4 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -223,8 +223,9 @@ jobs: # 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. + # setuptools reads pyproject.toml for the packaging guard. - name: Install dependencies - run: pip install pyyaml "jsonschema[format-nongpl]==4.26.0" "markdown==3.10.2" "pyte==0.8.2" "hypothesis==6.170.8" "vermin==1.9.2" + run: pip install pyyaml "jsonschema[format-nongpl]==4.26.0" "markdown==3.10.2" "pyte==0.8.2" "hypothesis==6.170.8" "vermin==1.9.2" "setuptools==80.9.0" # The full screen also runs under the 3.8 floor: the end-to-end tests # start install.py with the interpreter that runs them. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae2c25459..9fe1b0e7c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ validation above is its check. For code, profiles or platform files, these are the checks CI runs on a pull request (Python 3.12 or newer): ```bash -pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin +pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin setuptools python scripts/validate_pr.py --changed # the BIOS files the branch adds python scripts/validate_schemas.py --source-only # profiles and platform files python scripts/profile_sync.py --added --base upstream/main --strict # each profile the branch adds diff --git a/pyproject.toml b/pyproject.toml index bfb24f9c8..508eecc34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,10 @@ dev = [ "pyte>=0.8.2", "hypothesis>=6.100", "vermin>=1.9", + # The packaging guard reads this file through setuptools, which pip + # installs only in its isolated build environment and 3.12 no longer + # bundles: without it the guard skipped on every CI run. + "setuptools>=61", ] # The site is built by Astro Starlight from website/package.json and its # lockfile (npm ci --prefix website): no Python package builds it. diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index 006aab519..2d02f93da 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -974,7 +974,7 @@ validation above is its check. For code, profiles or platform files, these are the checks CI runs on a pull request (Python 3.12 or newer): ```bash -pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin +pip install pyyaml "jsonschema[format-nongpl]" markdown pyte hypothesis vermin setuptools python scripts/validate_pr.py --changed # the BIOS files the branch adds python scripts/validate_schemas.py --source-only # profiles and platform files python scripts/profile_sync.py --added --base upstream/main --strict # each profile the branch adds diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index fdcf30854..647510864 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -2766,6 +2766,10 @@ class TheProjectInstallsWithPip(unittest.TestCase): import importlib.util # noqa: PLC0415 if importlib.util.find_spec("setuptools") is None: + # The dev extra and CI install it: skipped there, the guard held + # nothing on any run. + if os.environ.get("CI"): + self.fail("CI must install setuptools") self.skipTest("setuptools is not installed") program = ( "from setuptools.dist import Distribution\n"