Repository navigation
Update mypy to 2.4.0 in the static analysis step - #700
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The Python 3.9 build failed at |
|
The |
There was a problem hiding this comment.
Approving. This changes only CI: the static analysis step now installs mypy 2.4.0 and skips Python 3.9, and no shipped code changes.
What I checked
- CI: all green on 8a798c3, in both the push run and the pull_request run. In
test (ubuntu-22.04, 3.10)the log showsmypy-2.4.0installed andBUILD PASSED with 5 warning(s). Intest (ubuntu-22.04, 3.9)the step is skipped and the tests and README check still run. Thewindows-latest, 3.9failure from the earlier attempt was the flakytest_stopping_a_cloud_backtest_can_delete_iton a step this change doesn't touch, and it passed on re-run. - No silent pass:
static_analysis.pykeeps only[call-arg]lines, so it would also pass if mypy errored out on a removed flag. I ran mypy 2.4.0 locally on this branch (Python 3.11) with the script's exact flags. It type-checks the whole package: 608 diagnostics across the usual codes, and no crash or flag error. - Same result as before: both 1.19.1 and 2.4.0 report 0
[call-arg]lines on this branch. When I added aLogger().info()call with no argument,python static_analysis.pyunder 2.4.0 reportedMissing positional argument "message" ... [call-arg]and failed the build, as it should. - Skipping 3.9: the check reads the same source on every interpreter and only looks at call arguments, so running it on 3.10 to 3.14 keeps its coverage. 3.9 support itself (
python_requires, the test matrix) is unchanged. Whether to drop 3.9 is a separate decision and doesn't belong in this change. - No other file pins mypy. No other repository is affected.
Risk: I set risk:low. It's a two-line CI change that's easy to revert, users see no difference, and the evidence above backs it. An end-to-end run doesn't apply because the CLI's behavior doesn't change.
There was a problem hiding this comment.
Approving: no blocking findings in this CI-only change.
Verification:
- Both current push and pull-request CI runs passed all 30 test jobs. All ten Linux Python 3.10–3.14 static-analysis steps passed; the two Linux Python 3.9 analysis steps were skipped while their tests and README checks passed. The Python 3.10 log confirms installation of mypy 2.4.0 and
BUILD PASSED with 5 warning(s). - Compared mypy 1.19.1 and 2.4.0 locally on Python 3.11 using the repository requirements and flake8 7.3.0. Both pass
python static_analysis.pyon unchanged source with the same five warnings. Temporary missing-argument, extra-positional-argument, and unexpected-keyword probes each produce the same[call-arg]diagnostics under both versions, and the script exits 1. The probes were removed afterward. - Upstream package metadata confirms mypy 2.4.0 requires Python >=3.10. Python 3.9 runtime support and its test matrix remain unchanged, although its separate static-analysis coverage is intentionally removed. No other repository update is needed.
An application end-to-end run is not applicable: no shipped CLI code or behavior changes.
Risk: risk:low retained. This is a small, readily reversible CI dependency/condition change, backed by passing matrix jobs and positive/negative analysis checks, with no user-facing API change.
Updates the static analysis step's mypy from 1.19.1 to 2.4.0.
static_analysis.pykeeps only mypy's[call-arg]errors, and they're the same under both versions:mypy 2.x requires Python 3.10 or newer (every release from 1.20.0 on declares
Requires-Python >=3.10), sopip install mypy==2.4.0failed on the Python 3.9 build. The static analysis step now skips Python 3.9. It still runs on Linux for 3.10 to 3.14, and the 3.9 jobs still install and run the tests.Testing
On Python 3.11, with
requirements.txt,mypy==2.4.0andflake8==7.3.0installed:python static_analysis.py: exit 0, with no call-argument mismatches, no undefined variables and the same 5 unused-import warnings as before.python -m pytest -s -rs: 2784 passed, 82 skipped.🤖 Generated with Claude Code