Skip to content

fix(deps): read pyproject.toml with tomllib instead of tomlkit - #1357

Merged
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
tiran:fix/pyproject-tomllib-read
Oct 5, 2026
Merged

LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
tiran:fix/pyproject-tomllib-read

Conversation

@tiran

@tiran tiran commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Description

What

get_pyproject_contents() only reads [build-system], so it does not need tomlkit's format-preserving parser. tomlkit (0.15.1) rejects some spec-valid files that re-open a super-table out of order, failing builds for affected packages (e.g. geventhttpclient). stdlib tomllib parses them correctly and is always available (Python >= 3.12).

Why

Closes: #1356

get_pyproject_contents() only reads [build-system], so it does not need
tomlkit's format-preserving parser. tomlkit (0.15.1) rejects some
spec-valid files that re-open a super-table out of order, failing builds
for affected packages (e.g. geventhttpclient). stdlib tomllib parses
them correctly and is always available (Python >= 3.12).

Co-Authored-By: Claude <claude@anthropic.com>
Closes: python-wheel-build#1356
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
tiran requested a review from a team as a code owner October 5, 2026 08:27
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: python-wheel-build/fromager/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6c884db-5f8f-4ef4-b102-d20049e82eef
📥 Commits

Reviewing files that changed from the base of the PR and between 3d0038c and a2c053d.

📒 Files selected for processing (2)
  • src/fromager/dependencies.py
  • tests/test_dependencies.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

get_pyproject_contents now uses the standard-library tomllib parser instead of tomlkit. A regression test checks that it reads build-system requirements from a valid TOML file that reopens a table.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to a2c05

The parser change addresses valid TOML files rejected by the previous parser. No merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the change: replacing tomlkit with tomllib to read pyproject.toml.
Description check ✅ Passed The description explains the parser change, the reason for it, and the linked issue.
Linked Issues check ✅ Passed Issue #1356 requires Fromager to parse the affected spec-valid pyproject.toml. get_pyproject_contents() now uses tomllib.loads, and the regression test covers out-of-order table reopening and ve…
Out of Scope Changes check ✅ Passed The parser replacement and regression test both directly address issue #1356. The diff shows no unrelated changes.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the ci label Oct 5, 2026
@LalatenduMohanty
LalatenduMohanty merged commit 1e3c39d into python-wheel-build:main Oct 5, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fromager / tomlkit fail to parse valid TOML

4 participants