Skip to content

CI builds kempnerforge with whatever hatchling is newest, so one broken hatchling release can fail every required check #785

Todo

Description

@amazloumi

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:66 declares requires = ["hatchling"] with no bound, and uv.lock does not lock build dependencies (it has no hatchling entry). So each build resolves [build-system] requires again, 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 sync in .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, :85 and :97 (examples); and uv pip install --resolution lowest-direct -e . in ci.yml:114-116 (dependency floors). In main's latest runs, all eight of these jobs that ran restored the uv cache and still logged Built 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-constraint does.

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

  1. added
    enhancement
    dependencies
    low
    on Dec 5, 2026
  2. self-assigned this
    on Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dependenciesenhancementlow

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions