Disallow warnings patches by ShaharNaveh · Pull Request #7249 · RustPython/RustPython
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
extra_tests/snippets/stdlib_io.py
📝 Walkthrough
Walkthrough
This PR adds platform-specific conditional attributes (musl/android), makes a decompressor accessor a const fn, and gates posix scheduler APIs on musl; no runtime logic changes.
Changes
| Cohort / File(s) | Summary |
|---|---|
Time / musl deprecation attributes crates/vm/src/stdlib/time.rs, crates/vm/src/stdlib/os.rs |
Added #[cfg_attr(target_env = "musl", allow(deprecated))] to multiple time-related functions and three StatResultData time fields to suppress deprecated warnings on musl targets. |
Posix imports & scheduler gating crates/vm/src/stdlib/posix.rs |
Reorganized imports (scoped import for signal) and added #[cfg(not(target_env = "musl"))] around scheduler-related types/functions to exclude them on musl. |
Compression const accessor & Android dead_code crates/stdlib/src/compression.rs |
Changed pub fn decompressor(&self) -> &D → pub const fn decompressor(&self) -> &D and added #[cfg_attr(target_os = "android", allow(dead_code))] to the method. |
Tests: IO isatty behavior extra_tests/snippets/stdlib_io.py |
Added a test that IOBase.isatty() on a closed file raises ValueError, including a minimal RawIOBase subclass for the test. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- Use CRT functions for time module on Windows #7090: Overlaps changes to time-related functions (
pyobj_to_time_t,current_time_t, etc.) incrates/vm/src/stdlib/time.rs. - Fix posix tests #5811: Related to posix spawn/scheduler handling in
crates/vm/src/stdlib/posix.rsand platform gating. - update test_time and implement more time module #7073: Also touches the same time conversion functions in
crates/vm/src/stdlib/time.rswith musl-related adjustments.
Poem
🐇 I hopped through code with care and glee,
Quieting musl warnings under a tree,
Made a decompressor constant, neat and small,
Scoped posix calls so builds won't sprawl,
A tiny test added — cheers from me! 🎉
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'Disallow warnings patches' accurately reflects the main objective of the PR, which involves adding cfg_attr attributes to suppress compiler warnings across multiple files rather than using warning suppression patches. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
Warning
Review ran into problems
🔥 Problems
Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.
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.