build: pin setuptools build backend version#138
Draft
MarkAtwood wants to merge 1 commit into
Draft
Conversation
pyproject.toml declared setuptools as an unbounded PEP 517 build requirement, so an isolated build resolves whatever setuptools is latest on the index — a compromised index or an unexpected future backend release could then affect build execution and the produced artifacts. cffi was already pinned; setuptools was not. Bound it to setuptools>=64,<81: the floor keeps compatibility with the declared requires-python>=3.10, and the ceiling caps the exposure to an unvetted future major of the build backend.
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Pins the setuptools PEP 517 build requirement in pyproject.toml to reduce exposure to unvetted upstream changes during isolated builds.
Changes:
- Add an explicit version range for
setuptoolsin[build-system].requires
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [build-system] | ||
| requires = ["setuptools", "cffi>=1.17"] | ||
| requires = ["setuptools>=64,<81", "cffi>=1.17"] |
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
pyproject.tomldeclaressetuptoolsas a PEP 517 build requirement with no version bound:cffiis pinned, butsetuptoolsis not. In an isolated build (the PEP 517 default), the packaging frontend resolves the latestsetuptoolsfrom the configured index before running the backend, so a compromised index, a malicious upstream release, or an unexpected future backend change can affect build execution and the produced artifacts.Fix
Bound the build backend:
>=64keeps compatibility with the declaredrequires-python = ">=3.10"(64 is wherepyproject.toml-driven config stabilized and is broadly available).<81caps exposure to an unvetted future major of the build backend.For stricter release reproducibility you could additionally install build requirements from a hash-pinned constraints file (
pip install --require-hashes); this PR does the minimal, in-tree version bound. Adjust the ceiling when a newersetuptoolsmajor is validated.Reported by static analysis (Fenrir finding 5426).
[fenrir-sweep:held]