feat(cli): support multiple constraints files via repeated -c flag#1128
feat(cli): support multiple constraints files via repeated -c flag#1128
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR implements support for multiple constraints files in the fromager CLI. The Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fromager/context.py`:
- Around line 143-150: The current logic skips writing input-constraints.txt if
it already exists, which can leave stale constraints in self.work_dir; change
the block that computes path_to_constraints_file and the lines list to always
write the merged constraints file (i.e., remove the exists() guard) so that
path_to_constraints_file.write_text("".join(lines)) runs on every invocation;
use the existing self.constraints.get_constraint(constraint_name) loop to
rebuild the contents before writing to input-constraints.txt.
In `@tests/test_context.py`:
- Around line 59-71: Update the test_pip_constraints_args_multiple_files
assertion to verify both constraint files contributed by checking the merged
file contains the numpy lower and upper bounds together and that numpy appears
only once: after ctx.setup() read merged_path and assert "numpy>=1.24" in
content, assert "numpy<2.0" in content, assert content.count("numpy") == 1, and
still assert "requests" is present and ctx.pip_constraint_args equals
["--constraint", os.fspath(merged_path)].
🪄 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: 72076441-bf4d-447a-a6fa-ec6931bdafd3
📒 Files selected for processing (4)
src/fromager/__main__.pysrc/fromager/context.pytests/test_cli.pytests/test_context.py
Add `multiple=True` to the global `-c`/`--constraints-file` Click option so users can pass multiple constraint sources (local files or remote URIs). WorkContext now loads all provided files in sequence, merging constraints via the combining logic added in #1125. The `pip_constraint_args` property writes a single merged constraints file for uv instead of passing the raw input file. Closes: #1096 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
dd7009b to
ab7325e
Compare
Closes: #1096
Pull Request Description
What
Why