Repository navigation
Require setuptools>=77 to build (PEP 639 license expression) - #210
Open
AtharvaTilewale wants to merge 1 commit into
Open
AtharvaTilewale wants to merge 1 commit into
AtharvaTilewale wants to merge 1 commit into
Conversation
pyproject.toml declares the license as the PEP 639 SPDX expression `license = "GPL-2.0-only"`, which setuptools only accepts from version 77.0 onwards, but the build requirement was left unpinned. Build environments that resolve an older setuptools therefore fail with "configuration error: `project.license` must be valid exactly by one definition" instead of reporting the unmet build requirement. Fixes pharmai#199
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building PLIP in an environment whose setuptools is older than 77 fails with a confusing
schema error rather than a message about setuptools (#199):
Nothing in that message says which build requirement is too old, so it reads as a defect
in
pyproject.toml.Root cause
pyproject.tomldeclares the license as the PEP 639 SPDX expressionlicense = "GPL-2.0-only"(line 7). setuptools only accepts the string form from 77.0onwards; before that,
project.licensehad to be a table ({text = ...}or{file = ...}), hence the "exactly by one definition" validation error. The buildrequirement on line 3 was just
requires = ["setuptools"], so nothing recorded that theproject now needs setuptools >= 77 to build.
What this change does
One line:
requires = ["setuptools>=77"].That makes the real build requirement explicit, so any front-end that resolves build
requirements reports an unmet
setuptools>=77instead of the schema error above. Nothingelse is changed — in particular
requires-pythonis left at>=3.6and no version isbumped, and
CHANGES.txtis left to the maintainers' release prep sincev3.0.1isalready tagged at the current
master.Validation
All builds below are of this branch, in throwaway venvs, with
build1.3.0:1. Reproducing the report — pre-patch (
requires = ["setuptools"]), setuptools75.8.0, no build isolation:
2. The check that changes — an isolated build whose build environment is constrained
to the old setuptools (
PIP_CONSTRAINT=setuptools==75.8.0):i.e. the failure now names the actual unmet build requirement.
3. Builds succeed with a setuptools that supports PEP 639 — post-patch, setuptools
80.9.0, no build isolation:
and the same with the default isolated build (pip resolves setuptools >= 77), plus
uv build --no-build-isolationin a venv with setuptools 80.9.0. The resulting wheelmetadata carries the SPDX expression:
Honest limitation: this pin cannot rescue a non-isolated build that already has an
old setuptools installed (
pip install --no-build-isolation .oruv build --no-build-isolationwith setuptools 75.8.0 still show the schema error, bothpre- and post-patch). No
pyproject.tomlchange can, because the front-end invokes thebackend before any build requirement is checked; such environments have to upgrade
setuptools. What the pin fixes is the declaration itself and every resolver-driven build.
The
python setup.py installpath from the original report no longer exists onmaster(setup.py/setup.cfg were removed in fc804af).
Fixes #199
Disclosure: this change was prepared with AI assistance and validated locally as described above.