Conversation
|
Warning Review limit reached
More reviews will be available in 40 minutes and 10 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR modernizes the async_py library with a version bump to 0.3.1, dependency updates, and significant backend refactoring. The synchronous command execution mechanism is rewritten to avoid blocking Tokio runtimes. Both PyO3 and RustPython backends receive improvements: PyO3 gains centralized error handling for string-to-CString conversion, and RustPython is modernized with a builder-pattern interpreter initialization and improved error reporting. Documentation is expanded with clarifications on async function handling and venv setup. ChangesLibrary modernization and backend refactoring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/rustpython_runner.rs (1)
218-223:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove stale traceback line offset for
main.py.Line 219–223 still subtracts 2 from traceback lines for
main.py, butRunFilenow runs the user file source directly, so this remapping is no longer valid and can misreport line numbers.Suggested fix
- let line = if file == "main.py" { - original_line - 2 // sys.path import has 2 additional lines - } else { - original_line - }; + let line = original_line;🤖 Prompt for 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. In `@src/rustpython_runner.rs` around lines 218 - 223, The code subtracts 2 from trace.lineno for file == "main.py" (original_line - 2) which is now incorrect since RunFile runs the user source directly; remove that special-case remapping and always use trace.lineno.get() (i.e., set line = original_line) so reported traceback line numbers are accurate; update the logic around original_line/line in rustpython_runner.rs (the branch that checks file == "main.py") to stop applying the -2 offset.
🤖 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 `@README.md`:
- Around line 104-106: The README statement about call_async_function is
misleading: instead of saying it is "only available with the default PyO3
backend", update the wording to clarify that the call_async_function API exists
for both backends but only functions at runtime with the PyO3 backend — with the
RustPython backend invoking call_async_function will return an "unsupported"
error at runtime; change the sentence around the symbol call_async_function to
explicitly mention PyO3 provides runtime support while RustPython reports
unsupported, so readers understand the API is present but behavior differs by
backend.
---
Outside diff comments:
In `@src/rustpython_runner.rs`:
- Around line 218-223: The code subtracts 2 from trace.lineno for file ==
"main.py" (original_line - 2) which is now incorrect since RunFile runs the user
source directly; remove that special-case remapping and always use
trace.lineno.get() (i.e., set line = original_line) so reported traceback line
numbers are accurate; update the logic around original_line/line in
rustpython_runner.rs (the branch that checks file == "main.py") to stop applying
the -2 offset.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: e888536d-7ca1-4e8f-93f3-6f0c3739abd2
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
.gitignoreCargo.tomlREADME.mdsrc/lib.rssrc/pyo3_runner.rssrc/rust.ymlsrc/rustpython_runner.rs
💤 Files with no reviewable changes (1)
- src/rust.yml
Summary by CodeRabbit
New Features
call_functionvscall_async_functionusage.uv-based workflow.Bug Fixes
Chores
serde_json,thiserror,tokio,pyo3,rustpython).