refactor(python): harden support script parsing#145
Conversation
- Require Python 3.13 for support-script tooling and align Ruff/Ty with that baseline. - Replace mypy with strict Ty checking in the Python workflow. - Parse TOML, JSON, argparse, and Semgrep inputs into typed boundary objects before downstream use. - Reject malformed Criterion estimates, non-finite timings, invalid confidence intervals, and malformed Semgrep result shapes. Closes #142
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR upgrades the project to Python 3.13, migrates type checking from mypy to ty, and refactors development scripts to parse and validate external inputs (TOML, JSON, CLI args) at boundaries into typed, validated objects before computation. ChangesPython 3.13 Upgrade and Parse-at-Boundaries Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
=======================================
Coverage 99.61% 99.61%
=======================================
Files 5 5
Lines 2846 2846
=======================================
Hits 2835 2835
Misses 11 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:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@justfile`:
- Around line 495-496: Update ty.toml so ty type-checks against Python 3.13:
open ty.toml and change the python-version key from "3.12" to "3.13" to match
.python-version and pyproject.toml (this affects the python-typecheck target
invoked by the justfile); ensure there are no other references to 3.12 in
ty.toml that need updating so ty uses the correct stdlib/features for Python
3.13.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 06c993f2-92af-4139-ab4f-31bd3b67226a
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
.python-versionjustfilepyproject.tomlscripts/check_docs_version_sync.pyscripts/check_semgrep_fixtures.pyscripts/criterion_dim_plot.pyscripts/tests/test_check_semgrep_fixtures.pyscripts/tests/test_criterion_dim_plot.py
Closes #142
Summary by CodeRabbit
Chores
New Features
Tests