fix(testing): clear watch screen via Console, not deprecated os.system#3102
Merged
marioevz merged 1 commit intoJul 3, 2026
Merged
Conversation
mypy's `deprecated` error code (enabled in pyproject.toml) flags the `os.system` call in the `--watch` file watcher. Use the Rich `Console.clear()` the watcher already holds instead of shelling out to `clear`/`cls`; it is cross-platform and removes the last `os` use, so drop `import os`. Why CI does not catch this: typeshed marks `os.system` `@deprecated` only for `sys.version_info >= (3, 14)`, and `[tool.mypy]` pins no `python_version`, so mypy targets whatever interpreter runs it. The `static` CI job has no setup-python step (unlike the fill jobs, which pin 3.14) and runs mypy under the runner default, CPython 3.13, where the marker is inactive. Local dev on 3.14 sees the error; CI stays green. Claude-Session: https://claude.ai/code/session_01Nw3qUNd4aNzVypuzNhbQyg
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3102 +/- ##
===================================================
+ Coverage 93.24% 93.30% +0.05%
===================================================
Files 624 624
Lines 36986 36986
Branches 3383 3383
===================================================
+ Hits 34489 34511 +22
+ Misses 1704 1693 -11
+ Partials 793 782 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
mypy's
deprecatederror code (enabled in pyproject.toml) flags theos.systemcall in the--watchfile watcher. Use the RichConsole.clear()the watcher already holds instead of shelling out toclear/cls; it is cross-platform and removes the lastosuse, so dropimport os.Why CI does not catch this: typeshed marks
os.system@deprecatedonly forsys.version_info >= (3, 14), and[tool.mypy]pins nopython_version, so mypy targets whatever interpreter runs it. ThestaticCI job has no setup-python step (unlike the fill jobs, which pin 3.14) and runs mypy under the runner default, CPython 3.13, where the marker is inactive. Local dev on 3.14 sees the error; CI stays green.🔗 Related Issues or PRs
N/A.
✅ Checklist
just static<type>(<area>):, where<type>and<area>come from an approrpriateC-<type>, respectivelyA-<area>, label. The title should match the a target squash commit message../tests/ported_static/: