Skip to content

Disallow warnings patches#7249

Merged
youknowone merged 3 commits intoRustPython:mainfrom
ShaharNaveh:disallow-warnings-patches
Feb 27, 2026
Merged

Disallow warnings patches#7249
youknowone merged 3 commits intoRustPython:mainfrom
ShaharNaveh:disallow-warnings-patches

Conversation

@ShaharNaveh
Copy link
Contributor

@ShaharNaveh ShaharNaveh commented Feb 27, 2026

Extracted from #7245 , related to #7245 (comment)

Summary by CodeRabbit

  • Chores

    • Suppressed deprecation warnings to improve compatibility on musl-based systems across time and OS utilities.
    • Improved Android compatibility by adjusting compilation behavior for decompression utilities.
    • Restricted scheduler configuration functionality on musl platforms to avoid unsupported paths.
  • Tests

    • Added a test verifying that isatty() raises on closed file objects and behaves on minimal raw IO implementations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9831d3 and 145103d.

📒 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) -> &Dpub 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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Code has been automatically formatted

The code in this PR has been formatted using:

  • ruff format
    Please pull the latest changes before pushing again:
git pull origin disallow-warnings-patches

@youknowone youknowone merged commit e51d6f0 into RustPython:main Feb 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants