From 503e77f79e37dfc1092cfb92bad61dc71316ed96 Mon Sep 17 00:00:00 2001 From: naeemkh Date: Sat, 5 Dec 2026 13:51:55 -0500 Subject: [PATCH 1/4] Hold the floor leg's other packages to releases before a cutoff date --- .github/workflows/ci.yml | 6 ++++++ CONTRIBUTING.md | 2 +- docs/getting-started/install.md | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 211c62f13..73c88c25a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,10 +110,16 @@ jobs: # test that sets propagate=True captures each record twice, and from rich 14.3.4 importing # httpx draws from Python's global random, which moves the RNG stream that # test_streaming_resume.py checks. + # --exclude-newer installs only releases uploaded before the cutoff, so the packages no bound + # fixes, such as the dependencies' own dependencies, stay the same from run to run, and an + # upstream release alone cannot turn this leg red. A PR that raises a bound, or adds a + # dependency, to a release uploaded after the cutoff moves the date forward in the same PR, + # to one at which this leg passes; the PR's own run of the leg tests it. - name: Install every runtime dependency at its lower bound run: >- uv pip install --resolution lowest-direct -e . --group video "pytest>=9.0.2" "pytest-timeout>=2.4.0" --constraint <(echo "rich<14.3.4") + --exclude-newer 2026-12-05T00:00:00Z - run: uv pip list # lowest-direct installs the lowest version the other requirements allow, not the declared # bound, so a bound set below what they allow would pass here without ever being installed. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab4d93c8b..8643c728f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -499,7 +499,7 @@ uv add --group dev Always use `uv`, never pip, conda, or venv. PyTorch is pinned to the CUDA 13.0 index in `pyproject.toml`. -Every runtime dependency needs a lower bound (`uv add` writes one at the version it resolves), and every library `kempnerforge` imports must be declared, even one another dependency already installs; `tests/unit/test_check_dependency_floors.py` checks both. The `unit-tests (dependency floors)` CI leg installs each runtime dependency at its lower bound and runs the unit tests, so a bound must be a version the code works with. Its install takes the lowest version the other requirements allow, which is newer than a bound set below that, so the leg first runs `scripts/check_dependency_floors.py`: it fails, naming each one, when a dependency in `[project].dependencies` or the `video` group is installed at a version other than its lower bound, is missing, or declares no inclusive lower bound (`>=`, `~=` or `==`). Raise such a bound to the version the leg installed, and lower a bound only after that leg passes with it. +Every runtime dependency needs a lower bound (`uv add` writes one at the version it resolves), and every library `kempnerforge` imports must be declared, even one another dependency already installs; `tests/unit/test_check_dependency_floors.py` checks both. The `unit-tests (dependency floors)` CI leg installs each runtime dependency at its lower bound and runs the unit tests, so a bound must be a version the code works with. Its install takes the lowest version the other requirements allow, which is newer than a bound set below that, so the leg first runs `scripts/check_dependency_floors.py`: it fails, naming each one, when a dependency in `[project].dependencies` or the `video` group is installed at a version other than its lower bound, is missing, or declares no inclusive lower bound (`>=`, `~=` or `==`). Raise such a bound to the version the leg installed, and lower a bound only after that leg passes with it. The install takes only releases uploaded before the cutoff date it passes to `--exclude-newer`, so the packages no bound fixes stay the same from run to run. A bound, or a new dependency, whose release is newer than the cutoff does not resolve there: move the date in `.github/workflows/ci.yml` forward in the same PR, to one at which the leg passes. ## Quick Reference diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md index 2277bd249..bc2f42cbf 100644 --- a/docs/getting-started/install.md +++ b/docs/getting-started/install.md @@ -69,6 +69,14 @@ The floors are tested on Python 3.12 only: some of the oldest releases, such as Pillow 10.0.0, PyYAML 6.0.1 and NumPy 1.26.1, publish no wheels for Python 3.13 or newer. +The packages that no bound fixes, such as the dependencies of the dependencies, +install at their newest release from before a fixed cutoff date, which the job +passes to `uv pip install --exclude-newer`. A new upstream release therefore +cannot change what the job installs, or turn it red on its own. The cutoff +applies to the bounds too: a change that raises a bound, or adds a dependency, +to a release uploaded after the cutoff also moves the date forward in +`ci.yml`, to one at which the job passes. + ## Optional: docs dependencies If you plan to preview docs locally, add the `docs` dependency group: From 3f8feb1e0ccba77159fdd695d0d2c1ff21d5bcf9 Mon Sep 17 00:00:00 2001 From: naeemkh Date: Sat, 5 Dec 2026 13:53:29 -0500 Subject: [PATCH 2/4] Rename gpu-tests to integration-cpu and say coverage counts the unit tests alone --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 4 +++- README.md | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73c88c25a..992e0e05b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,7 +155,7 @@ jobs: - if: needs.changes.outputs.code != 'true' && needs.changes.outputs.doc_pages == 'true' run: test "${{ needs.unit-tests-doc-pages.result }}" = "success" - gpu-tests: + integration-cpu: runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8643c728f..3b2614c82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -211,9 +211,11 @@ CI runs on every push to `main` and every PR. Every job that runs must pass befo |-----|----------------|---------| | `lint` | `ruff check` + `ruff format --check` + `pyright` | Every push/PR | | `unit-tests` | `pytest tests/unit/ -v --timeout=60` on Python 3.12 and 3.14 with `uv.lock`, and on Python 3.12 with every runtime dependency at its lower bound in `pyproject.toml` (the `unit-tests (dependency floors)` leg, which first checks that each one is installed at exactly that bound) | Manual dispatch, and pushes/PRs that change a file outside `docs/`, `examples/`, `plugins/`, `benchmarks/` and the repository files the workflow's `changes` job lists (such as `README.md`, `CONTRIBUTING.md` and `codebase-map.json`). When every changed file is in that set and one of them is `README.md` or a `.md` page under `docs/`, `examples/` or `plugins/`, the `unit-tests (doc pages)` job runs just the test that reads those pages | -| `gpu-tests` | `pytest tests/integration/` | Manual dispatch | +| `integration-cpu` | `pytest tests/integration/ -m "not slow"` on a CPU runner, so the integration tests that need a GPU skip | Manual dispatch | | `-tests` | `examples//tests` in one pytest session, manual-only tiers excluded | Pushes/PRs touching `examples//`, `kempnerforge/`, `pyproject.toml`, `uv.lock` or the workflow | +Every job runs on a CPU runner. No workflow runs the GPU tiers (`tests/distributed/`, `tests/e2e/` and `tests/smoke/`) or the integration tests that need a GPU, so run the ones your change affects on GPUs yourself (Step 3). The Codecov report and the coverage badge in `README.md` count the unit tests alone. + The most common CI failure is `ruff format --check`. Run `uv run ruff format --check .` locally before pushing. ## Testing diff --git a/README.md b/README.md index 29d0f4cb5..a5271e9ac 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

CI Docs - codecov + codecov: unit tests only License: MIT Python 3.12+ PyTorch 2.12+ @@ -260,7 +260,7 @@ tests/ # unit, integration, distributed, and end-to-end tests ## Contributing -See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the editor loop, build commands, and style conventions. +See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the editor loop, build commands, and style conventions. CI runs on CPU runners only: the coverage badge counts the unit tests (`tests/unit/`) alone, and the GPU tests run by hand. ## License From 265a756f7342d99adf042b4fd0dc7d44cacc7360 Mon Sep 17 00:00:00 2001 From: naeemkh Date: Sat, 5 Dec 2026 13:54:40 -0500 Subject: [PATCH 3/4] Keep CHANGELOG.md out of pull requests and group release notes by label --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- .github/release.yml | 24 ++++++++++++++++++++++++ .github/workflows/ci.yml | 1 + CONTRIBUTING.md | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/release.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a7c279ef3..82e00d2b3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,6 @@ ## Summary - + ## Testing - [ ] `uv run ruff check .` passes diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..271cbe4fe --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,24 @@ +# Categories for the release notes GitHub generates from merged pull requests. "Other changes" +# collects every pull request that matches no earlier category (labels: "*"). +changelog: + exclude: + labels: + - duplicate + - invalid + - wontfix + categories: + - title: Enhancements + labels: + - enhancement + - title: Bug fixes + labels: + - bug + - title: Documentation + labels: + - documentation + - title: Dependencies + labels: + - dependencies + - title: Other changes + labels: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 992e0e05b..d141c3020 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: - "!pyrightconfig.json" - "!.github/ISSUE_TEMPLATE/**" - "!.github/PULL_REQUEST_TEMPLATE.md" + - "!.github/release.yml" - "!.github/workflows/ci-example.yml" - "!.github/workflows/docs.yml" - "!docs/**" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b2614c82..1fb0dc921 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,6 +182,7 @@ Include `Closes #N` to auto-close the issue on merge. - Keep PRs focused. One feature or fix per PR. - If your change is large, break it into smaller PRs that each leave the codebase in a working state. - Respond to review comments. Push follow-up commits (don't force-push during review). +- Leave `CHANGELOG.md` alone: open PRs that each add an entry there conflict with one another. Put every user-visible change and behavior note in the PR's Summary instead. Each release's section of `CHANGELOG.md` is written when the release is cut, from GitHub's generated release notes, which group the merged PRs by label (`.github/release.yml`), and from those Summaries. ## Code Style From 4dbfe3273aa15af74fc6a4a6e4a5108981c67d65 Mon Sep 17 00:00:00 2001 From: naeemkh Date: Sat, 5 Dec 2026 15:29:06 -0500 Subject: [PATCH 4/4] Say how to move the floor leg's cutoff and what it holds fixed --- .github/workflows/ci.yml | 8 +++++--- CONTRIBUTING.md | 4 ++-- docs/getting-started/install.md | 14 ++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d141c3020..fb8246fe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,10 +112,12 @@ jobs: # httpx draws from Python's global random, which moves the RNG stream that # test_streaming_resume.py checks. # --exclude-newer installs only releases uploaded before the cutoff, so the packages no bound - # fixes, such as the dependencies' own dependencies, stay the same from run to run, and an - # upstream release alone cannot turn this leg red. A PR that raises a bound, or adds a + # fixes, such as the dependencies' own dependencies, stay the same from run to run, and a new + # release of one of them alone cannot turn this leg red. A PR that raises a bound, or adds a # dependency, to a release uploaded after the cutoff moves the date forward in the same PR, - # to one at which this leg passes; the PR's own run of the leg tests it. + # to a time already past at which this leg passes, in the same UTC form (uv reads a bare + # date in the runner's time zone, through the end of that day); the PR's own run of the leg + # tests it. - name: Install every runtime dependency at its lower bound run: >- uv pip install --resolution lowest-direct -e . --group video diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1fb0dc921..73f89734c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -215,7 +215,7 @@ CI runs on every push to `main` and every PR. Every job that runs must pass befo | `integration-cpu` | `pytest tests/integration/ -m "not slow"` on a CPU runner, so the integration tests that need a GPU skip | Manual dispatch | | `-tests` | `examples//tests` in one pytest session, manual-only tiers excluded | Pushes/PRs touching `examples//`, `kempnerforge/`, `pyproject.toml`, `uv.lock` or the workflow | -Every job runs on a CPU runner. No workflow runs the GPU tiers (`tests/distributed/`, `tests/e2e/` and `tests/smoke/`) or the integration tests that need a GPU, so run the ones your change affects on GPUs yourself (Step 3). The Codecov report and the coverage badge in `README.md` count the unit tests alone. +Every job runs on a CPU runner. No workflow runs the GPU tiers (`tests/distributed/`, `tests/e2e/` and `tests/smoke/`) or the integration tests that need a GPU, so run the ones your change affects on GPUs yourself (see GPU Access on SLURM Clusters and Step 3). The Codecov report and the coverage badge in `README.md` count the unit tests alone. The most common CI failure is `ruff format --check`. Run `uv run ruff format --check .` locally before pushing. @@ -502,7 +502,7 @@ uv add --group dev Always use `uv`, never pip, conda, or venv. PyTorch is pinned to the CUDA 13.0 index in `pyproject.toml`. -Every runtime dependency needs a lower bound (`uv add` writes one at the version it resolves), and every library `kempnerforge` imports must be declared, even one another dependency already installs; `tests/unit/test_check_dependency_floors.py` checks both. The `unit-tests (dependency floors)` CI leg installs each runtime dependency at its lower bound and runs the unit tests, so a bound must be a version the code works with. Its install takes the lowest version the other requirements allow, which is newer than a bound set below that, so the leg first runs `scripts/check_dependency_floors.py`: it fails, naming each one, when a dependency in `[project].dependencies` or the `video` group is installed at a version other than its lower bound, is missing, or declares no inclusive lower bound (`>=`, `~=` or `==`). Raise such a bound to the version the leg installed, and lower a bound only after that leg passes with it. The install takes only releases uploaded before the cutoff date it passes to `--exclude-newer`, so the packages no bound fixes stay the same from run to run. A bound, or a new dependency, whose release is newer than the cutoff does not resolve there: move the date in `.github/workflows/ci.yml` forward in the same PR, to one at which the leg passes. +Every runtime dependency needs a lower bound (`uv add` writes one at the version it resolves), and every library `kempnerforge` imports must be declared, even one another dependency already installs; `tests/unit/test_check_dependency_floors.py` checks both. The `unit-tests (dependency floors)` CI leg installs each runtime dependency at its lower bound and runs the unit tests, so a bound must be a version the code works with. Its install takes the lowest version the other requirements allow, which is newer than a bound set below that, so the leg first runs `scripts/check_dependency_floors.py`: it fails, naming each one, when a dependency in `[project].dependencies` or the `video` group is installed at a version other than its lower bound, is missing, or declares no inclusive lower bound (`>=`, `~=` or `==`). Raise such a bound to the version the leg installed, and lower a bound only after that leg passes with it. The install takes only releases uploaded before the cutoff date it passes to `--exclude-newer`, so the packages no bound fixes stay the same from run to run. A bound, or a new dependency, whose release is newer than the cutoff does not resolve there: move the date in `.github/workflows/ci.yml` forward in the same PR, to a time already past at which the leg passes, as a UTC timestamp. ## Quick Reference diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md index bc2f42cbf..6e302baa1 100644 --- a/docs/getting-started/install.md +++ b/docs/getting-started/install.md @@ -70,12 +70,14 @@ Pillow 10.0.0, PyYAML 6.0.1 and NumPy 1.26.1, publish no wheels for Python 3.13 or newer. The packages that no bound fixes, such as the dependencies of the dependencies, -install at their newest release from before a fixed cutoff date, which the job -passes to `uv pip install --exclude-newer`. A new upstream release therefore -cannot change what the job installs, or turn it red on its own. The cutoff -applies to the bounds too: a change that raises a bound, or adds a dependency, -to a release uploaded after the cutoff also moves the date forward in -`ci.yml`, to one at which the job passes. +install at the newest release the other requirements allow among those uploaded +before a fixed cutoff date, which the job passes to +`uv pip install --exclude-newer`. A new release of one of those packages +therefore cannot change what the job installs, or turn it red on its own. The +cutoff applies to the bounds too: a change that raises a bound, or adds a +dependency, to a release uploaded after the cutoff also moves the date forward +in `ci.yml`, to a time already past at which the job passes, written as a UTC +timestamp. ## Optional: docs dependencies