feat(resolver): add LocalIndexProvider#1139
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 (2)
📝 WalkthroughWalkthroughThis PR adds Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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/resolver.py`:
- Line 981: Fix the typo in the docstring that currently reads "Lookup
distribtions in a local directory" by changing "distribtions" to "distributions"
so the string becomes "Lookup distributions in a local directory"; locate the
triple-quoted docstring in src/fromager/resolver.py that contains the exact
phrase "Lookup distribtions in a local directory" and update it accordingly.
- Around line 1026-1089: The find_candidates method currently calls
os.scandir(path) which raises FileNotFoundError for missing package directories;
wrap the scandir call in a try/except FileNotFoundError and return an empty
iterable (i.e., stop iteration) instead of letting the exception propagate.
Specifically, in find_candidates, surround the os.scandir(path) iteration with a
try/except FileNotFoundError: block (or assign an empty iterator on error),
optionally logging the missing path when DEBUG_RESOLVER is set, and then
return/yield nothing so callers get an empty result rather than a crash.
🪄 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: 716d7663-1dd5-4ddd-b19a-86bf4d6928c4
📒 Files selected for processing (2)
src/fromager/resolver.pytests/test_resolver.py
4baae1c to
52719f9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/test_finders.py`:
- Around line 212-217: The test currently calls
wheels_only.find_candidates("example-pkg") and
sdists_only.find_candidates("example-pkg") directly inside all(...) which will
silently pass when the result is empty; change the test to first capture the
candidate lists (e.g., wheels_candidates =
wheels_only.find_candidates("example-pkg") and sdists_candidates =
sdists_only.find_candidates("example-pkg")), assert that each list is non-empty
(assert wheels_candidates and assert sdists_candidates), then perform the
existing assertions using all(...) on those captured lists; this uses the
existing finders.LocalIndexProvider and find_candidates symbols (wheels_only,
sdists_only) so the checks validate discovery actually returned candidates
before verifying their types.
🪄 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: 8326866a-e656-4617-b150-6dffb25dc960
📒 Files selected for processing (2)
src/fromager/finders.pytests/test_finders.py
`LocalIndexProvider` resolves packages from Fromager's local cache directories by scanning for wheel and sdist files. It supports flat and nested (PyPI-like) directory layouts. Caching is disabled since `os.scandir` and `parse_sdist/wheel_filename` are fast (1-3 microseconds per file). In the future, `fromager.finders`' `find_sdist()` and `find_wheel()` will use `LocalIndexProvider` internally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
52719f9 to
4780850
Compare
Pull Request Description
What
LocalIndexProviderresolves packages from Fromager's local cache directories by scanning for wheel and sdist files. It supports flat and nested (PyPI-like) directory layouts. Caching is disabled sinceos.scandirandparse_sdist/wheel_filenameare fast (1-3 microseconds per file).Why
In the future,
fromager.finders'find_sdist()andfind_wheel()will useLocalIndexProviderinternally.