build(deps-dev): update mypy requirement from ^1.13.0 to >=1.13,<3.0 in the dev-tools group - #21
build(deps-dev): update mypy requirement from ^1.13.0 to >=1.13,<3.0 in the dev-tools group#21dependabot[bot] wants to merge 1 commit into
Conversation
Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. Updates `mypy` to 2.0.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.13.0...v2.0.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 2.0.0 dependency-type: direct:development dependency-group: dev-tools ... Signed-off-by: dependabot[bot] <support@github.com>
LabelsThe following labels could not be found: Please fix the above issues or remove invalid values from |
WalkthroughThe PR updates the mypy development dependency constraint in ChangesMypy Dependency Version
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 `@pyproject.toml`:
- Line 26: The mypy version constraint (`mypy = ">=1.13,<3.0"`) allows mypy 2.x
which changes defaults; add explicit mypy 2.0 configuration under the
[tool.mypy] section to lock behavior: set local_partial_types = false and
strict_bytes = false to preserve mypy 1.x behavior (or, if you intend to adopt
mypy 2.0, document that decision and run/fix any new diagnostics). Update the
[tool.mypy] block with those two keys so CI behavior is deterministic.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5542f9fd-8b58-4402-b993-7a394c3ce722
📒 Files selected for processing (1)
pyproject.toml
| pytest-mock = "^3.14.0" | ||
| ruff = "^0.15.5" | ||
| mypy = "^1.13.0" | ||
| mypy = ">=1.13,<3.0" |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In mypy 2.x, what are the exact config keys and defaults for local_partial_types, strict_bytes, and allow_redefinition behavior in pyproject.toml?
💡 Result:
In mypy 2.x, the relevant pyproject.toml config keys are the same as the option names (under [tool.mypy]): 1) local_partial_types - Config key: local_partial_types - Default (mypy 2.0+): enabled/True (i.e., same as “--local-partial-types” by default) [1][2] - Behavior: prevents inferring a variable type from an empty container created at module top level or in a class body and updated in a function [3][2] 2) strict_bytes - Config key: strict_bytes - Default (mypy 2.0+): enabled/True [3][4] - Behavior: when strict_bytes is enabled, mypy does NOT treat bytearray and memoryview as subtypes of bytes [5][4] 3) allow_redefinition - Config key: allow_redefinition - Default: disabled/False (i.e., by default mypy won’t allow a variable to be redefined with an unrelated type) [5][6] - Behavior when True: enables redefinition of unannotated variables with an arbitrary type, and this requires local_partial_types to be enabled [5][6] - mypy 2.0 behavior note: in mypy 2.x, allow_redefinition behaves like the newer “allow-redefinition-new” behavior and requires local_partial_types; it does not allow giving two type annotations for the same variable (that code will generate an error); the legacy behavior is available via allow_redefinition_old [1][7] Example pyproject.toml snippet: [tool.mypy] local_partial_types = true strict_bytes = true allow_redefinition = false
Citations:
- 1: https://mypy-lang.blogspot.com/2026/05/mypy-20-relased.html
- 2: https://mypy.readthedocs.io/en/stable/command_line.html
- 3: https://mypy.readthedocs.io/en/stable/config_file.html
- 4: https://mypy.readthedocs.io/en/stable/command_line.html?highlight=strict
- 5: https://mypy.readthedocs.io/en/stable/config%5Ffile.html
- 6: https://mypy.readthedocs.io/en/latest/command_line.html?highlight=allow-redefinition
- 7: python/mypy@472d034
🏁 Script executed:
# Check the current pyproject.toml configuration around lines 52-56
sed -n '52,56p' pyproject.tomlRepository: cryptoxdog/l9-codegraph
Length of output: 148
🏁 Script executed:
# Also check the broader context of [tool.mypy] section
rg '\[tool\.mypy\]' -A 20 pyproject.tomlRepository: cryptoxdog/l9-codegraph
Length of output: 148
🏁 Script executed:
# Search for any PR or commit messages mentioning mypy 2.0 adoption
git log --all --oneline --grep="mypy" | head -20Repository: cryptoxdog/l9-codegraph
Length of output: 139
🏁 Script executed:
# Get full commit message for the mypy update
git log --all -p --grep="mypy" -- pyproject.toml | head -100Repository: cryptoxdog/l9-codegraph
Length of output: 2246
🏁 Script executed:
# Check if there's a CHANGELOG or migration notes
fd -i 'changelog|upgrade|migrate' -t f | head -10Repository: cryptoxdog/l9-codegraph
Length of output: 49
Add explicit mypy 2.0 config to prevent diagnostic drift
The version constraint >=1.13,<3.0 now allows mypy 2.x with behavior-changing defaults: local_partial_types and strict_bytes are enabled in 2.0+ but disabled in 1.x. Without explicit config, CI type-checking will change on the next mypy update.
Choose one approach:
- To preserve mypy 1.x behavior: Add these overrides under
[tool.mypy]:local_partial_types = false strict_bytes = false - To adopt mypy 2.0 behavior: Document this decision and verify no new diagnostics break the build.
🤖 Prompt for 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.
In `@pyproject.toml` at line 26, The mypy version constraint (`mypy =
">=1.13,<3.0"`) allows mypy 2.x which changes defaults; add explicit mypy 2.0
configuration under the [tool.mypy] section to lock behavior: set
local_partial_types = false and strict_bytes = false to preserve mypy 1.x
behavior (or, if you intend to adopt mypy 2.0, document that decision and
run/fix any new diagnostics). Update the [tool.mypy] block with those two keys
so CI behavior is deterministic.
|
Looks like mypy is updatable in another way, so this is no longer needed. |
Updates the requirements on mypy to permit the latest version.
Updates
mypyto 2.0.0Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
7a76500Remove +dev from version5a3ab3bChangelog for mypy 2.0 (#21422)f9c86e2Some changelog updates for 2.0 (#21413)519eaf1Bump librt to 0.10.0 (#21415)158a620Fix negative narrowing for containers (#21411)e556eb9Try fixing mypy mypyc wheels (#21392)f2c9797Expose --num-workers and --native-parser (#21387)db0cb2fBump ast-serialize cache version (#21388)1090ca6Bump ast-serialize version to 0.3.0 only (#21391)714ca9f[mypyc] Add note about librt.strings thread safety (#21383)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditionsSummary by CodeRabbit