Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/dependency-floors-constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# This file was autogenerated by uv via the following command:
# uv run python scripts/pin_dependency_floors.py
# pyproject.toml inputs sha256: 9c0622ae03c69f6d107eecec35bea0afba93c5e804f47454884cdc330308b34a
absl-py==2.4.0
aiohappyeyeballs==2.6.1
aiohttp==3.13.5
aiosignal==1.4.0
annotated-doc==0.0.4
annotated-types==0.7.0
anyio==4.13.0
attrs==26.1.0
av==17.1.0
cachetools==6.2.6
certifi==2026.2.25
cffi==2.0.0
charset-normalizer==3.4.7
click==8.3.1
cloudpickle==3.1.2
cryptography==49.0.0
cuda-bindings==13.5.0
cuda-pathfinder==1.5.0
cuda-toolkit==13.0.2
databricks-sdk==0.103.0
datasets==3.5.1
dill==0.3.8
docker-pycreds==0.4.0
fastapi==0.139.2
filelock==3.25.2
frozenlist==1.8.0
fsspec==2025.3.0
gitdb==4.0.12
gitpython==3.1.46
google-auth==2.56.2
grpcio==1.80.0
h11==0.16.0
hf-xet==1.4.3
httpcore==1.0.9
httpx==0.28.1
huggingface-hub==1.8.0
idna==3.11
importlib-metadata==8.9.0
iniconfig==2.3.0
jinja2==3.1.6
markdown==3.10.2
markdown-it-py==4.0.0
markupsafe==3.0.3
mdurl==0.1.2
mlflow-skinny==3.1.0
mpmath==1.3.0
multidict==6.7.1
multiprocess==0.70.16
networkx==3.6.1
numpy==1.26.1
nvidia-cublas==13.1.1.3
nvidia-cuda-cupti==13.0.85
nvidia-cuda-nvrtc==13.0.88
nvidia-cuda-runtime==13.0.96
nvidia-cudnn-cu13==9.20.0.48
nvidia-cufft==12.0.0.61
nvidia-cufile==1.15.1.6
nvidia-curand==10.4.0.35
nvidia-cusolver==12.0.4.66
nvidia-cusparse==12.6.3.3
nvidia-cusparselt-cu13==0.8.1
nvidia-ml-py==11.470.66
nvidia-nccl-cu13==2.29.7
nvidia-nvjitlink==13.0.88
nvidia-nvshmem-cu13==3.4.5
nvidia-nvtx==13.0.85
opentelemetry-api==1.44.0
opentelemetry-sdk==1.44.0
opentelemetry-semantic-conventions==0.65b0
packaging==25.0
pandas==2.1.2
pillow==10.0.0
platformdirs==4.9.4
pluggy==1.6.0
propcache==0.4.1
protobuf==5.29.6
psutil==5.9.4
pyarrow==15.0.0
pyasn1==0.6.4
pyasn1-modules==0.4.2
pycparser==3.0
pydantic==2.12.5
pydantic-core==2.41.5
pygments==2.20.0
pytest==9.0.2
pytest-timeout==2.4.0
python-dateutil==2.9.0.post0
pytz==2026.6
pyyaml==6.0.1
regex==2026.3.32
requests==2.33.1
rich==14.3.3
safetensors==0.7.0
sentry-sdk==2.57.0
setproctitle==1.3.8
setuptools==81.0.0
shellingham==1.5.4
six==1.17.0
smmap==5.0.3
sqlparse==0.5.5
starlette==1.0.0
sympy==1.14.0
tensorboard==2.17.1
tensorboard-data-server==0.7.2
tokenizers==0.22.1
torch==2.12.0+cu130
torchao==0.18.0
tqdm==4.67.3
transformers==5.4.0
triton==3.7.0
typer==0.24.1
typing-extensions==4.15.0
typing-inspection==0.4.2
tzdata==2026.6
urllib3==2.6.3
uvicorn==0.44.0
wandb==0.17.2
werkzeug==3.1.8
xxhash==3.6.0
yarl==1.23.0
zipp==4.1.0
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ jobs:
with:
python-version: "3.12"
- run: uv venv
# pytest and rich stay at the versions uv.lock holds (9.0.2 and 14.3.3): from pytest 9.1 a
# 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.
- name: Check that the pins are current with pyproject.toml
run: uv run --no-sync python scripts/pin_dependency_floors.py --check
- 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")
"pytest>=9.0.2" "pytest-timeout>=2.4.0"
--constraint .github/dependency-floors-constraints.txt
- 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.
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ CI runs on every push to `main` and every PR. Every job that runs must pass befo
| Job | What it checks | Runs on |
|-----|----------------|---------|
| `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 |
| `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` and every other package at the version `.github/dependency-floors-constraints.txt` pins (the `unit-tests (dependency floors)` leg, which first checks that those pins are current and then that each dependency is installed at exactly its 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 |
| `<example>-tests` | `examples/<example>/tests` in one pytest session, manual-only tiers excluded | Pushes/PRs touching `examples/<example>/`, `kempnerforge/`, `pyproject.toml`, `uv.lock` or the workflow |

Expand Down Expand Up @@ -501,6 +501,8 @@ Always use `uv`, never pip, conda, or venv. PyTorch is pinned to the CUDA 13.0 i

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 other package the leg installs is pinned in `.github/dependency-floors-constraints.txt`, so a new release cannot change what it tests. After changing `[project].dependencies`, the `video` group, `requires-python` or a `[tool.uv]` setting other than `default-groups` in `pyproject.toml`, run `uv run python scripts/pin_dependency_floors.py` and commit the file it rewrites: the leg checks the file before its install and fails with that command when the file is out of date, and so does `tests/unit/test_pin_dependency_floors.py`. The script resolves the leg's install with `uv pip compile`. A package keeps its pin while the new requirements allow it, and a package the file does not pin yet takes its `uv.lock` version when they allow that. To re-derive every pin from `uv.lock` where the floors allow it and `uv.lock` has a version for Linux, delete the file and run the script.

## Quick Reference

```bash
Expand Down
19 changes: 19 additions & 0 deletions codebase-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,13 @@
"tested_by": [
"tests/unit/test_check_dependency_floors.py"
]
},
"scripts/pin_dependency_floors.py": {
"purpose": "Writes .github/dependency-floors-constraints.txt, which pins every package the floor leg installs: uv pip compile of that install (--resolution lowest-direct, Python 3.12, x86_64 manylinux_2_28) preferring the file's own pins, then uv.lock's, and none for a declared dependency, plus a sha256 of the pyproject.toml inputs. --check compares that hash with the standard library only; the leg runs it before its install",
"entry": "main()",
"tested_by": [
"tests/unit/test_pin_dependency_floors.py"
]
}
},
"tests": {
Expand Down Expand Up @@ -2550,6 +2557,18 @@
],
"count": 19
},
"tests/unit/test_pin_dependency_floors.py": {
"classes": [
"TestInputHash(5)",
"TestNames(2)",
"TestPreferences(2)",
"TestWrite(3)",
"TestRunUv(3)",
"TestCheck(3)",
"TestThisRepo(4)"
],
"count": 22
},
"tests/unit/test_checkpoint_numpy.py": {
"classes": [
"TestTrainStateFromNumpy2(2)"
Expand Down
5 changes: 4 additions & 1 deletion docs/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ If all four pass, your environment is ready.
not go through the lock, `pyproject.toml` gives every runtime dependency a
lower bound, the oldest release KempnerForge supports. CI tests those bounds:
its `unit-tests (dependency floors)` job installs every runtime dependency at
its lower bound on Python 3.12 and runs the unit tests. Before the tests,
its lower bound on Python 3.12 and runs the unit tests. Every other package it
installs is held at the version `.github/dependency-floors-constraints.txt`
pins, which `scripts/pin_dependency_floors.py` writes, so a new release
elsewhere cannot change what the job tests. Before the tests,
`scripts/check_dependency_floors.py` fails the job if a dependency did not
install at exactly its lower bound, which happens when the bound is lower than
the other requirements allow. The commands are in `.github/workflows/ci.yml`.
Expand Down
Loading
Loading