Skip to content

build(deps-dev): update mypy requirement from ^1.13.0 to >=1.13,<3.0 in the dev-tools group - #21

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/dev-tools-3d6bf4b3df
Closed

build(deps-dev): update mypy requirement from ^1.13.0 to >=1.13,<3.0 in the dev-tools group#21
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/dev-tools-3d6bf4b3df

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 11, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on mypy to permit the latest version.
Updates mypy to 2.0.0

Changelog

Sourced from mypy's changelog.

Mypy Release Notes

Next Release

Mypy 2.0

We’ve just uploaded mypy 2.0.0 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. There are also changes to options and defaults. You can install it as follows:

python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs.

Enable --local-partial-types by Default

This flag affects the inference of types based on assignments in other scopes. For now, explicitly disabling this continues to be supported, but this support will be removed in the future as the legacy behaviour is hard to support with other current and future features in mypy, like the daemon or the new implementation of flexible redefinitions.

Contributed by Ivan Levkivskyi, Jukka Lehtosalo, Shantanu in PR 21163.

Enable --strict-bytes by Default

Per PEP 688, mypy no longer treats bytearray and memoryview values as assignable to the bytes type.

Contributed by Shantanu in PR 18371.

New Behavior for --allow-redefinition

The --allow-redefinition flag now behaves like --allow-redefinition-new in mypy 1.20 and earlier. The new behavior is generally more flexible. For example, you can have different types for a variable in different blocks:

# mypy: allow-redefinition
def foo(cond: bool) -> None:
if cond:
for x in ["a", "b"]:
# Type of "x" is "str" here
...
else:
for x in [1, 2]:
# Type of "x" is "int" here
...

... (truncated)

Commits

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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will 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 version will 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 conditions

Summary by CodeRabbit

  • Chores
    • Updated development tool dependency version constraints for improved compatibility.

Review Change Stack

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>
@dependabot @github

dependabot Bot commented on behalf of github May 11, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: automated, dependencies. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Walkthrough

The PR updates the mypy development dependency constraint in pyproject.toml from caret-pinned (^1.13.0) to a lower-bound constraint (>=1.13,<3.0), allowing mypy 2.x versions to be used while maintaining a minimum of 1.13.

Changes

Mypy Dependency Version

Layer / File(s) Summary
Dependency Constraint Update
pyproject.toml
Mypy version constraint widened from ^1.13.0 to >=1.13,<3.0, enabling compatibility with mypy 2.x releases.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: widening the mypy dev dependency range in the dev-tools group.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dependabot/pip/dev-tools-3d6bf4b3df

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9496795 and f11f44d.

📒 Files selected for processing (1)
  • pyproject.toml

Comment thread pyproject.toml
pytest-mock = "^3.14.0"
ruff = "^0.15.5"
mypy = "^1.13.0"
mypy = ">=1.13,<3.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 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:


🏁 Script executed:

# Check the current pyproject.toml configuration around lines 52-56
sed -n '52,56p' pyproject.toml

Repository: cryptoxdog/l9-codegraph

Length of output: 148


🏁 Script executed:

# Also check the broader context of [tool.mypy] section
rg '\[tool\.mypy\]' -A 20 pyproject.toml

Repository: 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 -20

Repository: 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 -100

Repository: 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 -10

Repository: 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.

@dependabot @github

dependabot Bot commented on behalf of github Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Looks like mypy is updatable in another way, so this is no longer needed.

@dependabot dependabot Bot closed this Jul 27, 2026
@dependabot
dependabot Bot deleted the dependabot/pip/dev-tools-3d6bf4b3df branch July 27, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants