init warnings before site by youknowone · Pull Request #6771 · RustPython/RustPython
📝 Walkthrough
Walkthrough
The run_rustpython function is refactored to move the warnings module initialization block earlier in the startup sequence, immediately after creating the new scope. A duplicate initialization block that previously appeared after the site import is removed, eliminating the redundant import attempt.
Changes
| Cohort / File(s) | Summary |
|---|---|
Warnings module initialization reorderingsrc/lib.rs |
Moved the warnings module import initialization to execute immediately after scope creation instead of after site import; removed duplicate initialization block that appeared later in the startup sequence. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- Initialize warnings module during interpreter startup to process #6766: Directly related — both PRs modify
run_rustpythonto initialize the warnings module early in interpreter startup with failure warning handling.
Suggested reviewers
- fanninpm
Poem
🐰 A hop and a shuffle, the warnings now lead,
Early in startup, they take their own seed,
No duplication to clutter the way,
Cleaner and swifter, a better today! ✨
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'init warnings before site' directly and clearly describes the main change: moving warnings module initialization before site import. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
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 @coderabbitai help to get the list of available commands and usage tips.