Repository navigation
Description
What happened
CI builds kempnerforge with whatever hatchling release is newest, and nothing in the repo holds it back, so a hatchling release that breaks the build would fail every job that installs the project, the required lint and unit-tests checks included, and block every PR until a PR pins it.
pyproject.toml:66declaresrequires = ["hatchling"]with no bound, anduv.lockdoes not lock build dependencies (it has no hatchling entry). So each build resolves[build-system] requiresagain, in an isolated environment, and takes the newest hatchling and the newest of the packages hatchling needs (packaging, pathspec, pluggy, tomlkit, trove-classifiers).- Every job that installs the project builds it this way:
uv syncin.github/workflows/ci.yml:69(lint),:88(unit-tests on 3.12 and 3.14),:134(doc pages) and:160(gpu-tests), in.github/workflows/docs.yml:32(docs build) and in.github/workflows/ci-example.yml:70,:85and:97(examples); anduv pip install --resolution lowest-direct -e .inci.yml:114-116(dependency floors). In main's latest runs, all eight of these jobs that ran restored the uv cache and still loggedBuilt kempnerforge, so the cache does not keep an earlier build. --constraint, which the floors job already uses to hold rich back, does not reach that isolated build, and neither does[tool.uv] constraint-dependencies; the same pin passed as--build-constraintdoes.
This is the same class of outside-release breakage as #746, for the build rather than the installed packages, and as #591, where a new interpreter on the runner failed the unit tests on every pull request.
Expected: CI builds kempnerforge with a pinned hatchling, so a new hatchling release changes nothing until a PR moves the pin.
Possible fix: pin the build dependencies once for every uv command, for example with [tool.uv] build-constraint-dependencies (it goes into uv.lock, and uv sync, uv build and uv pip install -e . run from the repo root all honor it), or bound hatchling in [build-system] requires.
Related: #746, #784 (its body notes this gap), #783 (its --exclude-newer cutoff would also hold the floors job's build, but not the uv sync jobs).
Reproduction
From the repo root, with uv. --no-deps only skips the runtime dependencies (torch and the rest); the build is the same.
grep -A2 '^\[build-system\]' pyproject.toml
echo "hatchling entries in uv.lock: $(grep -c '^name = "hatchling"$' uv.lock)"
echo "newest hatchling on PyPI: $(echo hatchling | uv pip compile -q --no-header --no-annotate - | grep '^hatchling==')"
venv=$(mktemp -d)/venv
uv venv -q "$venv"
built_with() { sed -n 's/^Generator: //p' "$venv"/lib/python3*/site-packages/kempnerforge-*.dist-info/WHEEL; }
uv pip install -q --python "$venv" --no-deps -e . --constraint <(echo "hatchling==1.27.0") && echo "with --constraint hatchling==1.27.0: built with $(built_with)"
uv pip install -q --python "$venv" --no-deps --reinstall -e . --build-constraint <(echo "hatchling==1.27.0") && echo "with --build-constraint hatchling==1.27.0: built with $(built_with)"Error / traceback
None. Nothing fails today: each build takes the newest hatchling, and a --constraint pin does not change it. Output on main:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
hatchling entries in uv.lock: 0
newest hatchling on PyPI: hatchling==1.33.0
with --constraint hatchling==1.27.0: built with hatchling 1.33.0
with --build-constraint hatchling==1.27.0: built with hatchling 1.27.0
Environment
- GPU type and count: none (CPU reproduction)
- Nodes: 1
- PyTorch version: none (the reproduction installs kempnerforge without its dependencies)
- uv 0.13.8 with CPython 3.12.11; on main, CI ran uv 0.13.13
- KempnerForge commit: 3899909
Activity