Conversation
Updated versions of external linters and type stubs used in CI: - mypy: 1.17.1 → 1.19.1 - types-psutil: 7.0.0.20250801 → 7.2.2.20260130 - types-setuptools: 80.9.0.20250801 → 82.0.0.20260210 These upgrades ensure compatibility with the latest Python versions and improve type checking and CI reliability for: - Tools/clinic - Tools/cases_generator/ - Tools/peg_generator/
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates CI development tooling by bumping mypy, related type stub packages, and Hypothesis to newer versions to keep static analysis and property-based testing dependencies current in the Tools directory. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBumped development and testing dependency versions, exposed the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Fix a mypy type error in Lib/test/libregrtest/utils.py caused by an outdated type annotation for threading.excepthook. In recent Python versions, threading.excepthook returns `object` instead of `None`. The existing annotation expected Callable[..., None] | None, which caused an incompatible assignment error when assigning threading.excepthook. Update the annotation to Callable[..., object] | None to match the current return type while keeping compatibility across supported Python versions.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Lib/test/libregrtest/utils.py (1)
153-155: Remove commented-out dead code.Line 153 contains a commented-out type annotation that should be removed entirely—version control preserves history, so old code does not need to be left as comments.
Proposed fix
-#orig_threading_excepthook: Callable[..., None] | None = None - orig_threading_excepthook: Callable[..., object] | None = NoneFor consistency with
sys.unraisablehook, consider updatingorig_unraisablehookon line 129 fromCallable[..., None]toCallable[..., Any], since typeshed typessys.unraisablehookas returningAny.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Lib/test/libregrtest/utils.py` around lines 153 - 155, Remove the commented-out dead code line containing the old type annotation for orig_threading_excepthook (delete the entire commented line) and update the orig_unraisablehook annotation from Callable[..., None] to Callable[..., Any] | None to match sys.unraisablehook's typeshed typing; also add/import Any from typing if not already imported and leave orig_threading_excepthook as the active declaration (orig_threading_excepthook: Callable[..., object] | None = None).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Lib/test/libregrtest/utils.py`:
- Around line 153-155: Remove the commented-out dead code line containing the
old type annotation for orig_threading_excepthook (delete the entire commented
line) and update the orig_unraisablehook annotation from Callable[..., None] to
Callable[..., Any] | None to match sys.unraisablehook's typeshed typing; also
add/import Any from typing if not already imported and leave
orig_threading_excepthook as the active declaration (orig_threading_excepthook:
Callable[..., object] | None = None).
Fix a mypy error in Tools/clinic caused by the libclinic.cpp submodule not being visible as an attribute of the libclinic package. Add an explicit import and export in libclinic/__init__.py so that static analysis can detect the submodule while preserving the existing runtime behavior.
This PR updates several development dependencies used for linters, type checking, and property-based testing in CI.
Updated Dependencies
mypyTools/clinic,Tools/cases_generator/,Tools/peg_generator/)types-psutilpeg_generatortypes-setuptoolspeg_generatorhypothesisTools/requirements-hypothesis.txt)Release Notes / Changelog
CI and Type Checking
mypyand type stubs to improve static analysis and maintain compatibility with the latest Python versions.Tools/clinic,Tools/cases_generator/, andTools/peg_generator/.Testing
hypothesisto ensure property-based tests run with the latest features and fixes.Why These Updates Matter
hypothesisfixes and enhancements.Summary by Sourcery
Update development tooling and testing dependencies under Tools to keep CI checks and property-based tests current and compatible with newer Python versions.
Build:
Tests:
Summary by CodeRabbit
Chores
New Features