Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.
Python cliconsumer-gpudpofine-tuningggufhuggingfacellmllmopslocal-ailocal-llmloralow-vrammachine-learningollamapeftpythonpytorchqlorasfttransformers
ci: measure coverage only outside pull requests; pin the Docker guard range (#2109)
Alpamys Makazhan5c01d5e71047
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 4f17996b..c16e439e 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -231,11 +231,14 @@ jobs:# starts a second approval run, in a concurrency group of its own so it cannot# cancel the first, and no later push cancels it either. Add other labels# before `ci:full`.- # - Coverage uploads from the ubuntu / 3.11 cell only -- the ubuntu cell every- # gated run has and a quick run does not -- so a pull request's Codecov report- # arrives at approval. That cell is also the only one that MEASURES coverage- # (2026-10-19), so the 77% floor is enforced there: a quick run has no such cell- # and does not check it, while the approval run a merge waits for does.+ # - Coverage is not measured on a pull request at all (2026-10-21). The one cell that+ # measures it, enforces the 77% floor and uploads to Codecov is `test (ubuntu-latest,+ # 3.11)` of a run that is NOT a pull request: the nightly run, a manual dispatch and+ # a push to release/**. Every cell of a pull-request run, that cell at approval+ # included, runs the suite with `--no-cov`. What it gives up: a pull request has no+ # Codecov report, and one that drops coverage below the floor merges green and turns+ # the next nightly run red, on `main`. A push to `main` is a quick run, which has no+ # ubuntu / 3.11 cell (it never did), so it does not measure either.# - A draft pull request runs nothing: `plan` and `lint` are skipped by their# own `if:`, and every other job needs `plan`. The merge gate holds for the# reason above -- the required `test (...)` contexts are never created -- and@@ -1041,6 +1044,19 @@ jobs:# coverage and 85 s with it (CI itself is not measured yet). The two steps carry# opposite conditions, so exactly one runs in a cell.#+ # 2026-10-21: and only outside a pull request. The ruling of that day was coverage+ # "only on push to main and nightly", about 165 job-minutes a day: the approval run+ # of every pull request ran this step in ubuntu / 3.11 and paid the tracer there.+ # `github.event_name != 'pull_request'` is on this step and on the upload below,+ # and the opposite (`== 'pull_request' ||`) on the next one, so a pull request runs+ # the next step in every cell, ubuntu / 3.11 included, and still writes report.xml.+ # This step runs for the nightly run, a manual dispatch and a push to release/**.+ # A push to `main` is QUICK (ubuntu / 3.12 only) and has no ubuntu / 3.11 cell, so it+ # runs the next step as before: it never measured coverage, and the ruling's "a drop+ # shows on the merge commit" would need the quick cell to measure it, which costs the+ # tracer on every push to main (see tests/test_ci_full_matrix_on_approval.py,+ # TestCoverageIsMeasuredInOneCell).+ ## 2026-10-20: a hung test is capped three ways. `--timeout=600 --timeout-method=thread`# (pytest-timeout, in the dev extra) fails ONE test that has run for ten minutes: the# thread method works on Windows (no SIGALRM there) and in an xdist worker, which it@@ -1066,24 +1082,27 @@ jobs:# two finished tests of one worker, an upper bound), and the longest test step of the# last 7 days took 27.7 minutes, so none of the caps can fire on a healthy run. A test# that needs longer marks itself `@pytest.mark.timeout(N)`.- if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'+ if: env.RUN_SUITE == 'true' && github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'timeout-minutes: 45run: pytest tests/ -n logical --dist loadfile -v --tb=short -o faulthandler_timeout=300 --timeout=600 --timeout-method=thread --max-worker-restart=2 --junitxml=report.xml --cov=soup_cli --cov-report=xml:coverage.xml --cov-report=term-missing:skip-covered- name: Run unit tests without coverage# Same options as the step above minus the coverage reports; `--junitxml` stays in# both, because the nightly test-count badge reads report.xml from ubuntu / 3.11,- # which runs the step above since #1805 and ran this one before: with it in both,- # moving the badge or the coverage cell cannot leave the badge without a report.- # The same two caps.- if: env.RUN_SUITE == 'true' && (matrix.os != 'ubuntu-latest' || matrix.python-version != '3.11')+ # which runs the step above (it is a schedule run, never a pull request) and ran+ # this one before #1805: with it in both, moving the badge or the coverage cell+ # cannot leave the badge without a report, and a pull request still writes one.+ # The exact opposite of the step above: every cell of a pull request, and every cell+ # of any run but ubuntu / 3.11. The same two caps.+ if: env.RUN_SUITE == 'true' && (github.event_name == 'pull_request' || matrix.os != 'ubuntu-latest' || matrix.python-version != '3.11')timeout-minutes: 45run: pytest tests/ -n logical --dist loadfile -v --tb=short -o faulthandler_timeout=300 --timeout=600 --timeout-method=thread --max-worker-restart=2 --junitxml=report.xml --no-cov- name: Upload coverage to Codecov- # ubuntu / 3.11 is the ubuntu cell every gated run has (release, full,- # approval) and a quick run does not: the oldest supported Python. It was 3.11+ # The cell that measures coverage, nowhere else: ubuntu / 3.11 of a run that is not a+ # pull request (release, nightly, manual dispatch), the same condition as "Run unit+ # tests with coverage" -- a pull request has no coverage.xml to send. It was 3.11# until the approval run of 2026-10-07 stopped having that cell, 3.10 from then# on, and 3.11 again since #1805 made it the oldest.- if: env.RUN_SUITE == 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'+ if: env.RUN_SUITE == 'true' && github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'uses: codecov/codecov-action@v4with:files: coverage.xmldiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 5133c5f7..14130820 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -635,6 +635,17 @@ branch runs every cell. Python 3.13 runs in the nightly and release runs only, non a pull request, so a failure that exists only there shows on `main` in thenext nightly run.+**Coverage is measured on `main`, not on a pull request.** Every `test (...)`+cell of a pull-request run, `test (ubuntu-latest, 3.11)` at approval included,+runs the suite with `--no-cov`: a pull request gets no Codecov report and the+77% floor is not checked on it. The nightly run on `main` (and a manual dispatch+or a push to a `release/**` branch) measures coverage in `test (ubuntu-latest,+3.11)`, checks the floor and uploads the report. So a change that takes coverage+below 77% merges green and turns the next nightly run red. A plain+`pytest tests/` measures it and enforces the floor locally (it is in the+`addopts` of `pyproject.toml`), so run that before you push a change that+removes tests or adds untested code.+**A draft pull request runs no CI.** Nothing starts while a pull request is adraft, whatever is pushed to it. Mark it ready for review and the quick setstarts on its current head.diff --git a/tests/test_ci_docs_only_fast_path.py b/tests/test_ci_docs_only_fast_path.pyindex 676f3853..c851c664 100644--- a/tests/test_ci_docs_only_fast_path.py+++ b/tests/test_ci_docs_only_fast_path.py@@ -126,15 +126,22 @@ def _suite_runs(cell: dict[str, str], docs_only: str) -> str:return _render(str(_jobs()["test"]["env"]["RUN_SUITE"]), context)-def _steps_that_run(cell: dict[str, str], docs_only: str) -> list[str]:- """The steps of the `test` job that run in *cell* of a pull-request run."""+def _steps_that_run(+ cell: dict[str, str],+ docs_only: str,+ *,+ event_name: str = "pull_request",+ ref: str = "refs/pull/7/merge",+) -> list[str]:+ """The steps of the `test` job that run in *cell* of a run: a pull-request run unless the+ event is given (a pull request is the only run that can be docs-only)."""context = {**_plan_outputs(docs_only),"matrix": cell,"env": {"RUN_SUITE": _suite_runs(cell, docs_only)},"github": {- "event_name": "pull_request",- "ref": "refs/pull/7/merge",+ "event_name": event_name,+ "ref": ref,"repository": "MakazhanAlpamys/Soup",},"steps": {@@ -464,8 +471,25 @@ class TestTheTestCellsSkipOnlyInADocsOnlyRun:def test_the_coverage_cell_and_the_badge_step_never_run_in_a_docs_only_run(self) -> None:"""No coverage report exists to upload when the cell that measures it did nothing."""coverage_cell = {"os": "ubuntu-latest", "python-version": "3.11"}- assert "Upload coverage to Codecov" not in _steps_that_run(coverage_cell, "true")- assert "Upload coverage to Codecov" in _steps_that_run(coverage_cell, "false")+ assert _steps_that_run(coverage_cell, "true") == []++ def test_no_pull_request_measures_or_uploads_coverage_and_the_nightly_run_does(self) -> None:+ """2026-10-21: the approval run's ubuntu / 3.11 (the cell that measured and uploaded+ coverage) runs the suite with `--no-cov`, docs-only or not, and uploads nothing; the+ same cell of the nightly run measures, checks the floor and uploads."""+ coverage_cell = {"os": "ubuntu-latest", "python-version": "3.11"}+ for docs_only in ("true", "false"):+ steps = _steps_that_run(coverage_cell, docs_only)+ assert "Run unit tests with coverage" not in steps, docs_only+ assert "Upload coverage to Codecov" not in steps, docs_only+ pull_request = _steps_that_run(coverage_cell, "false")+ assert "Run unit tests without coverage" in pull_request+ nightly = _steps_that_run(+ coverage_cell, "false", event_name="schedule", ref="refs/heads/main"+ )+ assert "Run unit tests with coverage" in nightly+ assert "Upload coverage to Codecov" in nightly+ assert "Run unit tests without coverage" not in nightly@pytest.mark.parametrize("matrix", ("QUICK_MATRIX", "APPROVAL_MATRIX"))def test_a_docs_only_run_still_creates_every_context_branch_protection_waits_on(diff --git a/tests/test_ci_full_matrix_on_approval.py b/tests/test_ci_full_matrix_on_approval.pyindex 7efe67d9..b35c44ee 100644--- a/tests/test_ci_full_matrix_on_approval.py+++ b/tests/test_ci_full_matrix_on_approval.py@@ -1522,76 +1522,158 @@ class TestADraftRunsNothing:#: Here it is the ordinary case, a cell that works.WORKING_CELL = {"env": {"RUN_SUITE": "true"}}--class TestCoverageUpload:- def test_one_cell_of_every_gated_run_uploads_and_a_quick_run_uploads_nothing(self):- """The upload is pinned to one cell. Pinned to a cell the approval run does not- have, it would stop every pull request's Codecov report without a red mark."""- steps = _jobs()["test"]["steps"]- upload = [step for step in steps if step.get("name") == "Upload coverage to Codecov"]- assert len(upload) == 1, upload- condition = str(upload[0].get("if", ""))-- def uploading(name: str) -> list[dict[str, str]]:- return [- cell- for cell in _cell_dicts(_matrix(name))- if _truthy(_Expression(condition, {"matrix": cell, **WORKING_CELL}).value())- ]-- for name in ("APPROVAL_MATRIX", "FULL_MATRIX", "RELEASE_MATRIX"):- assert len(uploading(name)) == 1, (name, uploading(name))- assert uploading("QUICK_MATRIX") == []--COVERAGE_STEP = "Run unit tests with coverage"NO_COVERAGE_STEP = "Run unit tests without coverage"+UPLOAD_STEP = "Upload coverage to Codecov"+BADGE_STEP = "Update test count badge"#: The one cell that measures coverage, enforces the floor and uploads the report: ubuntu on-#: the oldest supported Python (3.10 until #1805).+#: the oldest supported Python (3.10 until #1805), in a run that is not a pull request+#: (2026-10-21: no pull-request run measures coverage).COVERAGE_CELL = {"os": "ubuntu-latest", "python-version": "3.11"}ALL_MATRICES = ("RELEASE_MATRIX", "FULL_MATRIX", "APPROVAL_MATRIX", "QUICK_MATRIX")+def _is_pull_request(run: Any) -> bool:+ return bool(run.values[0]["github"]["event_name"] == "pull_request")+++#: The runs of EVENTS that are a pull request (quick, approval), and the ones that are not (a+#: push to main, a push to release/**, the nightly run, a manual dispatch). The coverage rule+#: of 2026-10-21 is about exactly this split.+PULL_REQUEST_RUNS = [run for run in EVENTS if _is_pull_request(run)]+OTHER_RUNS = [run for run in EVENTS if not _is_pull_request(run)]+#: The cells that measure coverage in each kind of run that is not a pull request: exactly one+#: in the runs that have an ubuntu / 3.11 cell, none in a quick run. A push to ``main`` is a+#: quick run (ubuntu / 3.12 only), so it measures nothing; it never did.+MEASURING_CELLS: dict[str, list[dict[str, str]]] = {+ "RELEASE": [COVERAGE_CELL],+ "FULL": [COVERAGE_CELL],+ "QUICK": [],+}++def _test_step(name: str) -> dict[str, Any]:steps = [step for step in _jobs()["test"]["steps"] if step.get("name") == name]assert len(steps) == 1, (name, steps)return steps[0]-def _cells_running(step: dict[str, Any], matrix: str) -> list[dict[str, str]]:+def _context(cell: dict[str, str], run: Any) -> dict[str, Any]:+ """What a step's ``if:`` sees in *cell* of a run shaped like *run* (a ``github`` context+ from EVENTS). The event matters: a missing ``github`` would read as null and make+ ``github.event_name != 'pull_request'`` true for every cell."""+ assert run["github"]["event_name"], run+ return {**run, "matrix": cell, **WORKING_CELL}+++def _cells_running(step: dict[str, Any], matrix: str, run: Any) -> list[dict[str, str]]:condition = str(step.get("if", "true"))return [cellfor cell in _cell_dicts(_matrix(matrix))- if _truthy(_Expression(condition, {"matrix": cell, **WORKING_CELL}).value())+ if _truthy(_Expression(condition, _context(cell, run)).value())]+def _suite_steps_in(cell: dict[str, str], run: Any) -> list[str]:+ """Which of the two steps that run the suite run in *cell*: exactly one, or it is a bug."""+ context = _context(cell, run)+ return [+ name+ for name in (COVERAGE_STEP, NO_COVERAGE_STEP)+ if _truthy(_Expression(str(_test_step(name).get("if", "true")), context).value())+ ]+++class TestCoverageUpload:+ def test_there_is_exactly_one_upload_step(self):+ steps = [s for s in _jobs()["test"]["steps"] if s.get("name") == UPLOAD_STEP]+ assert len(steps) == 1, steps++ @pytest.mark.parametrize(("context", "kind"), OTHER_RUNS)+ def test_a_run_that_is_not_a_pull_request_uploads_from_the_measuring_cell_only(+ self, context, kind+ ):+ """Pinned to a cell the run does not have, it would stop every Codecov report without+ a red mark; pinned to two, they would race. The nightly, manual and release runs have+ the cell; a push to main is a quick run and has none."""+ found = _cells_running(_test_step(UPLOAD_STEP), f"{kind}_MATRIX", context)+ assert found == MEASURING_CELLS[kind], (kind, found)++ @pytest.mark.parametrize(("context", "kind"), PULL_REQUEST_RUNS)+ def test_a_pull_request_uploads_nothing_the_approval_run_included(self, context, kind):+ """2026-10-21: the approval run's ubuntu / 3.11 measured coverage and uploaded it; a+ pull request has no Codecov report now, and no coverage.xml to send."""+ assert _cells_running(_test_step(UPLOAD_STEP), f"{kind}_MATRIX", context) == []++class TestCoverageIsMeasuredInOneCell:"""2026-10-19: coverage is measured in ubuntu / 3.11 only (3.10 until #1805), the cellthat uploads it. The floor is enforced there; every other cell runs the suite with- `--no-cov`."""-- @pytest.mark.parametrize("matrix", ("RELEASE_MATRIX", "FULL_MATRIX", "APPROVAL_MATRIX"))- def test_every_gated_run_measures_coverage_in_exactly_the_uploading_cell(self, matrix):- assert _cells_running(_test_step(COVERAGE_STEP), matrix) == [COVERAGE_CELL]- assert _cells_running(_test_step("Upload coverage to Codecov"), matrix) == [COVERAGE_CELL]-- def test_a_quick_run_measures_no_coverage_and_so_does_not_check_the_floor(self):- """Known and accepted: the quick run has no ubuntu / 3.11 cell. The approval run a- merge waits for has it, and so does the nightly run."""- assert _cells_running(_test_step(COVERAGE_STEP), "QUICK_MATRIX") == []+ `--no-cov`. 2026-10-21: and only in a run that is not a pull request (the nightly run, a+ manual dispatch, a push to release/**): a pull-request run measures nothing, the approval+ run's ubuntu / 3.11 included."""++ def test_the_events_table_has_every_kind_of_run_the_rule_tells_apart(self):+ """CONTROL. The loops below are vacuous over a table that lost a kind of run."""+ assert sorted(run.id for run in OTHER_RUNS) == [+ "manual-dispatch",+ "nightly",+ "push-main",+ "push-release",+ ]+ assert {run.values[1] for run in PULL_REQUEST_RUNS} == {"QUICK", "APPROVAL"}+ assert {run.values[1] for run in OTHER_RUNS} == set(MEASURING_CELLS)+ # The change matters because the approval run HAS the cell that used to measure.+ assert COVERAGE_CELL in _cell_dicts(_matrix("APPROVAL_MATRIX"))++ @pytest.mark.parametrize(("context", "kind"), PULL_REQUEST_RUNS)+ def test_no_cell_of_a_pull_request_run_measures_coverage(self, context, kind):+ assert _cells_running(_test_step(COVERAGE_STEP), f"{kind}_MATRIX", context) == []++ @pytest.mark.parametrize(("context", "kind"), PULL_REQUEST_RUNS)+ def test_every_cell_of_a_pull_request_run_runs_the_suite_with_no_cov(self, context, kind):+ """The approval run's ubuntu / 3.11 included: it takes the other step, `--no-cov`, which+ turns the tracer and the floor off."""+ for cell in _cell_dicts(_matrix(f"{kind}_MATRIX")):+ assert _suite_steps_in(cell, context) == [NO_COVERAGE_STEP], cell+ args = shlex.split(str(_test_step(NO_COVERAGE_STEP)["run"]))+ assert "--no-cov" in args+ assert not [arg for arg in args if arg.startswith("--cov")], args++ @pytest.mark.parametrize(("context", "kind"), OTHER_RUNS)+ def test_a_run_that_is_not_a_pull_request_measures_in_exactly_the_uploading_cell(+ self, context, kind+ ):+ """On the nightly run, a manual dispatch and a push to release/**: ubuntu / 3.11 runs+ the measuring step (so the floor applies there), every other cell runs `--no-cov`."""+ matrix = f"{kind}_MATRIX"+ measuring = _cells_running(_test_step(COVERAGE_STEP), matrix, context)+ assert measuring == MEASURING_CELLS[kind], (kind, measuring)+ assert measuring == _cells_running(_test_step(UPLOAD_STEP), matrix, context)+ for cell in _cell_dicts(_matrix(matrix)):+ expected = COVERAGE_STEP if cell in measuring else NO_COVERAGE_STEP+ assert _suite_steps_in(cell, context) == [expected], (kind, cell)++ def test_a_push_to_main_measures_nothing_known_and_accepted(self):+ """A push to main is a quick run: ubuntu / 3.12 only, no ubuntu / 3.11 cell, so there+ is no cell to measure in and the floor is not checked on the merge commit (it never+ was). The nightly run checks it. Making the quick cell measure instead costs the+ tracer on every push to main; that is a ruling for the maintainers, not a default."""+ push = _push("refs/heads/main")+ assert COVERAGE_CELL not in _cell_dicts(_matrix("QUICK_MATRIX"))+ assert _cells_running(_test_step(COVERAGE_STEP), "QUICK_MATRIX", push) == []+ assert _cells_running(_test_step(UPLOAD_STEP), "QUICK_MATRIX", push) == []+ assert _cells_running(_test_step(NO_COVERAGE_STEP), "QUICK_MATRIX", push) == [+ {"os": "ubuntu-latest", "python-version": "3.12"}+ ]- @pytest.mark.parametrize("matrix", ALL_MATRICES)- def test_every_cell_runs_the_suite_exactly_once(self, matrix):+ @pytest.mark.parametrize(("context", "kind"), EVENTS)+ def test_every_cell_runs_the_suite_exactly_once(self, context, kind):"""A cell that ran neither step would test nothing; one that ran both would run the- suite twice. The two conditions are opposites."""- with_coverage = _cells_running(_test_step(COVERAGE_STEP), matrix)- without = _cells_running(_test_step(NO_COVERAGE_STEP), matrix)- cells = _cell_dicts(_matrix(matrix))- assert len(with_coverage) + len(without) == len(cells), matrix- assert not [cell for cell in with_coverage if cell in without], matrix- assert sorted(with_coverage + without, key=str) == sorted(cells, key=str), matrix+ suite twice. The two conditions are opposites, for every kind of run."""+ for cell in _cell_dicts(_matrix(f"{kind}_MATRIX")):+ assert len(_suite_steps_in(cell, context)) == 1, (kind, cell)def test_the_coverage_step_measures_and_the_other_one_does_not(self):measured = shlex.split(str(_test_step(COVERAGE_STEP)["run"]))@@ -1616,11 +1698,26 @@ class TestCoverageIsMeasuredInOneCell:@pytest.mark.parametrize("step", (COVERAGE_STEP, NO_COVERAGE_STEP))def test_both_steps_still_write_what_later_steps_read(self, step):"""The nightly test-count badge reads report.xml from ubuntu / 3.11, which runs the- measuring step since #1805 and ran the unmeasured one before: `--junitxml` stays in- both, so moving the badge or the coverage cell cannot leave it without a report."""+ measuring step (a schedule run is never a pull request) and ran the unmeasured one+ before #1805: `--junitxml` stays in both, so moving the badge or the coverage cell+ cannot leave it without a report, and a pull request writes one as well."""args = shlex.split(str(_test_step(step)["run"]))assert "--junitxml=report.xml" in args, step+ def test_the_badge_step_runs_only_where_the_measuring_step_wrote_its_report(self):+ """The badge is a nightly step of ubuntu / 3.11; in that cell of that run one of the+ two suite steps ran, and each of them writes report.xml. No pull request gets here."""+ nightly = _on_event("schedule")+ nightly["github"]["repository"] = "MakazhanAlpamys/Soup"+ badge = _test_step(BADGE_STEP)+ assert _cells_running(badge, "FULL_MATRIX", nightly) == [COVERAGE_CELL]+ (name,) = _suite_steps_in(COVERAGE_CELL, nightly)+ assert name == COVERAGE_STEP+ assert "--junitxml=report.xml" in shlex.split(str(_test_step(name)["run"]))+ for run in PULL_REQUEST_RUNS:+ matrix = f"{run.values[1]}_MATRIX"+ assert _cells_running(badge, matrix, run.values[0]) == [], run.id+def _contributing() -> str:"""CONTRIBUTING.md with its line wrapping collapsed."""diff --git a/tests/test_ci_test_cells_run_in_parallel.py b/tests/test_ci_test_cells_run_in_parallel.pyindex 7f8e1cc9..692e9f8b 100644--- a/tests/test_ci_test_cells_run_in_parallel.py+++ b/tests/test_ci_test_cells_run_in_parallel.py@@ -30,7 +30,8 @@ CONTRIBUTING = ROOT / "CONTRIBUTING.md"RUN_STEP = "Run unit tests with coverage"# 2026-10-19: every cell but ubuntu / 3.11 (3.10 until #1805) runs this one, with-# `--no-cov`. Coverage is measured in one cell+# `--no-cov`; 2026-10-21: so does every cell of a pull-request run, ubuntu / 3.11 included.+# Coverage is measured in one cell of a run that is not a pull request# (tests/test_ci_full_matrix_on_approval.py::TestCoverageIsMeasuredInOneCell); the# parallelism pins below hold for both steps, because most cells now run the second.NO_COV_STEP = "Run unit tests without coverage"diff --git a/tests/test_dockerfile_python.py b/tests/test_dockerfile_python.pyindex 2259a976..a645144e 100644--- a/tests/test_dockerfile_python.py+++ b/tests/test_dockerfile_python.py@@ -12,7 +12,9 @@ real ``docker build`` is the only thing that proves the image runs):- the base image's own Python is inside ``requires-python``, which is read from``pyproject.toml`` and not copied, so a bump of the range fails here until the base follows;-- the Dockerfile refuses a Python outside the range before it downloads a wheel;+- the Dockerfile refuses a Python outside the range before it downloads a wheel, and its+ guard's floor and ceiling are ``requires-python``'s own, both read from ``pyproject.toml``+ (a guard that is looser or tighter than the range is the same bug from the other side);- the install is ``soup-cli[...]==${SOUP_VERSION}`` from a build arg with no default, followedby a check that the package that landed is that version;- ``docker.yml`` derives ``SOUP_VERSION`` from the git tag and stops on any other ref.@@ -195,11 +197,18 @@ class TestBaseImage:assert match, f"cannot read the range off the Python guard: {command}"low = (int(match.group(1)), int(match.group(2)))high = (int(match.group(3)), int(match.group(4)))- required_low, _required_high = _bounds(_requires_python())- assert low >= required_low, (- f"the guard admits Python {low[0]}.{low[1]} but requires-python "+ required_low, required_high = _bounds(_requires_python())+ assert low == required_low, (+ f"the guard's floor is Python {low[0]}.{low[1]} but requires-python "f"'{_requires_python()}' starts at {required_low[0]}.{required_low[1]}: "- "raise the guard's floor with it"+ "a guard below it admits a Python pip would not install for, one above it refuses "+ "a Python the package supports; move the guard with the range"+ )+ assert high == required_high, (+ f"the guard's ceiling is Python {high[0]}.{high[1]} (excluded) but requires-python "+ f"'{_requires_python()}' stops below {required_high[0]}.{required_high[1]}: "+ "a guard above it admits a Python soup-cli does not support and pip would quietly "+ "install an older release; move the guard with the range")assert low <= _base_python(_base_image()) < high, ("the guard rejects the Python the base image ships, so every build would fail"