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 211c62f13..fb8246fe3 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/**" @@ -110,10 +111,18 @@ 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 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 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 "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. @@ -149,7 +158,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 ab4d93c8b..73f89734c 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 @@ -211,9 +212,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 (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. ## Testing @@ -499,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. +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/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 diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md index 2277bd249..6e302baa1 100644 --- a/docs/getting-started/install.md +++ b/docs/getting-started/install.md @@ -69,6 +69,16 @@ 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 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 If you plan to preview docs locally, add the `docs` dependency group: