build: declare the setuptools build backend floor (F-5426)

[build-system] declared bare `setuptools`, so isolated builds resolved
whatever version the index served at build time. This repo has no uv.lock,
so CI's `uv build --wheel` re-resolves the backend on every run.

Declare `setuptools>=77`. Nothing was broken before this: an unpinned
resolver always fetched a recent backend, so the build worked. The floor is
measured, not chosen. The PEP 639 `license` expression and `license-files`
key already in this file each require setuptools >= 77 independently (76 and
older reject either one alone, while the older `license = {file = ...}`
table form passes), so the project had an undeclared >= 77 requirement that
stayed invisible precisely because the version floated. Declaring it keeps a
build environment pinned below 77 from failing mid-build on an opaque
`project.license` config error with no hint that the fix is an upgrade.

No upper bound, matching the floor-only convention of every other bound in
this file (`cffi>=1.17`, `typing-extensions>=4.4.0`). A ceiling would not
address the reported risk anyway -- a malicious point release satisfies any
range, so only hash-pinned build requirements help there -- and setuptools
ships majors often enough (7 since 2025-03, with 81 and 82 two days apart)
that a stale ceiling silently excludes working versions instead of
protecting anything.

Verified: builds at 77.0.3 and 83.0.0, 76.1.0 refused at resolve time,
License-Expression intact in wheel METADATA, ruff clean, 196 passed.
pull/138/head
Mark Atwood 2026-07-09 17:00:36 -07:00
parent b297f8a00b
commit ef980e4d09
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ dependencies = [
Homepage = "https://github.com/wolfssl/wolfcrypt-py"
[build-system]
requires = ["setuptools", "cffi>=1.17"]
# setuptools >= 77 is required for the PEP 639 `license` expression and
# `license-files` above; 76 and older reject them.
requires = ["setuptools>=77", "cffi>=1.17"]
build-backend = "setuptools.build_meta:__legacy__"
[dependency-groups]