Skip to content

fix: Remove some generated casts that aren't necessary with mypy v2#1436

Merged
dbanty merged 2 commits into
mainfrom
renovate/lock-file-maintenance
May 25, 2026
Merged

fix: Remove some generated casts that aren't necessary with mypy v2#1436
dbanty merged 2 commits into
mainfrom
renovate/lock-file-maintenance

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented May 18, 2026

This PR contains the following updates:

Update Change
lockFileMaintenance All locks refreshed

🔧 This Pull Request updates lock files to use the latest dependency versions.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "before 4am on monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/lock-file-maintenance branch from 1aa4626 to 04e02d6 Compare May 18, 2026 11:28
@dbanty
Copy link
Copy Markdown
Collaborator

dbanty commented May 25, 2026

@copilot can you update the code to get it working with mypy v2?

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

@copilot can you update the code to get it working with mypy v2?

Done in commit 90afc56. Two changes were needed for mypy v2:

  1. end_to_end_tests/test_end_to_end.py: Replaced mypy.api.run() with subprocess.run([sys.executable, "-m", "mypy", ...]). mypy v2 is compiled with mypyc (.so files), which causes an ImportError: module 'mypy.main' is not in sys.modules when called in-process from within a pytest run.

  2. openapi_python_client/templates/literal_enum.py.jinja (+ 7 golden record files): Removed cast(Literal[...], value) from the generated check_* functions. mypy v2 now properly narrows the type of value to Literal[...] after an if value in set[Literal[...]] check, making the cast redundant (and flagging it as [redundant-cast]).

Copilot AI requested a review from dbanty May 25, 2026 19:26
Copilot finished work on behalf of dbanty May 25, 2026 19:26
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented May 25, 2026

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@dbanty dbanty changed the title chore(deps): lock file maintenance fix: Remove some generated casts that aren't necessary with mypy v2 May 25, 2026
@dbanty dbanty added this pull request to the merge queue May 25, 2026
Merged via the queue into main with commit cc2ebc9 May 25, 2026
22 checks passed
@dbanty dbanty deleted the renovate/lock-file-maintenance branch May 25, 2026 21:20
@knope-bot knope-bot Bot mentioned this pull request May 25, 2026
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.

2 participants