Skip to content

fix(bootstrap): auto-disable constraints and extend e2e test coverage#1057

Open
rd4398 wants to merge 1 commit intopython-wheel-build:mainfrom
rd4398:disable-constraints
Open

fix(bootstrap): auto-disable constraints and extend e2e test coverage#1057
rd4398 wants to merge 1 commit intopython-wheel-build:mainfrom
rd4398:disable-constraints

Conversation

@rd4398
Copy link
Copy Markdown
Contributor

@rd4398 rd4398 commented Apr 13, 2026

Two related fixes for --multiple-versions flag:

  1. Auto-disable constraints with --multiple-versions

    • When --multiple-versions flag is enabled, automatically set skip_constraints=True because constraints.txt cannot handle multiple versions of the same package
    • Log informative message: "automatically disabling constraints generation (incompatible with --multiple-versions)"
  2. Extend e2e test to verify dependency chain handling

    • Use generous constraint range (flit-core>=3.9,<3.12) instead of pinning to single version
    • Verify that multiple versions of flit-core are built (not just tomli), confirming --multiple-versions works for entire chain
    • Check for at least 2 flit-core versions (test found 3)
    • Remove || true since constraints are now auto-disabled

The e2e test now validates that --multiple-versions bootstraps multiple versions of both top-level packages AND their dependencies, providing better test coverage.

Fixes: #1044
Fixes: #1045

Two related fixes for --multiple-versions flag:

1. **Auto-disable constraints with --multiple-versions**
   - When --multiple-versions flag is enabled, automatically set
     skip_constraints=True because constraints.txt cannot handle
     multiple versions of the same package
   - Log informative message: "automatically disabling constraints
     generation (incompatible with --multiple-versions)"

2. **Extend e2e test to verify dependency chain handling**
   - Use generous constraint range (flit-core>=3.9,<3.12) instead
     of pinning to single version
   - Verify that multiple versions of flit-core are built (not just
     tomli), confirming --multiple-versions works for entire chain
   - Check for at least 2 flit-core versions (test found 3)
   - Remove `|| true` since constraints are now auto-disabled

The e2e test now validates that --multiple-versions bootstraps
multiple versions of both top-level packages AND their dependencies,
providing better test coverage.

Fixes: python-wheel-build#1044
Fixes: python-wheel-build#1045
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@rd4398 rd4398 requested a review from a team as a code owner April 13, 2026 17:44
@rd4398 rd4398 requested review from EmilienM and dhellmann April 13, 2026 17:44
@mergify mergify bot added the ci label Apr 13, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The changes implement automatic constraint disabling for the --multiple-versions mode and extend the e2e test to verify multiple build backend versions are exercised. The bootstrap command now forces skip_constraints=True when --multiple-versions is enabled, eliminating constraint generation failures. The test script updates the generated constraints from a pinned version to a version range (flit-core>=3.9,<3.12), removes error suppression that previously masked constraint failures, and adds post-bootstrap verification that at least 2 distinct flit_core-3.*.whl wheels were actually built.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: auto-disabling constraints with --multiple-versions and extending e2e test coverage.
Description check ✅ Passed The description provides clear details on both fixes, including the rationale for auto-disabling constraints and extending test coverage with specific examples.
Linked Issues check ✅ Passed The PR fully addresses both issues: constraints are auto-disabled when --multiple-versions is enabled [#1044], and e2e test uses generous constraint ranges to verify multiple dependency versions build [#1045].
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issues: bootstrap.py adds auto-disable logic for constraints, and the e2e test is extended to validate multiple versions of dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@e2e/test_bootstrap_multiple_versions.sh`:
- Line 13: The trap currently expands $constraints_file when the trap is
registered rather than at exit, and won't handle paths with spaces; change the
trap registration for rm -f $constraints_file to use single quotes around the
command and quote the variable inside (i.e., trap 'rm -f "$constraints_file"'
EXIT) so the variable is expanded at runtime and paths with spaces are handled
safely; update the trap line that references constraints_file accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45560f03-d9fd-44c4-a6d5-fe08dd291471

📥 Commits

Reviewing files that changed from the base of the PR and between b8f4441 and c4cea97.

📒 Files selected for processing (2)
  • e2e/test_bootstrap_multiple_versions.sh
  • src/fromager/commands/bootstrap.py

@jskladan
Copy link
Copy Markdown

FWIW, LGTM @rd4398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants