Skip to content

Add mypy cache-fix skill documentation#6971

Draft
mdegat01 wants to merge 1 commit into
mainfrom
chore/mypy-cache-fix-skill
Draft

Add mypy cache-fix skill documentation#6971
mdegat01 wants to merge 1 commit into
mainfrom
chore/mypy-cache-fix-skill

Conversation

@mdegat01

Copy link
Copy Markdown
Contributor

Proposed change

Add a repository skill document at .github/skills/mypy-cache-fix/SKILL.md describing how to diagnose and fix intermittent mypy internal errors caused by cache corruption.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@mdegat01 mdegat01 added the chore Other changes that don't modify src or test files label Jun 24, 2026
description: >-
Diagnose and fix mypy pre-commit failures in this repo. Use when: mypy hook
crashes with INTERNAL ERROR, mypy exits with code 2, mypy fails silently, or
you suspect mypy cache corruption after seeing sqlite3 DatabaseError.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've never seen this, how often does this happen? Is it really worth a skill? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's possible its just a devcontainer issue but I see it all the time. I think maybe it happens on rebases? I'm not sure why. But like after you asked me to push this to another PR when I came back to the other PR it immediately ran into it again. This time it fixed it itself instead of trying to resort to no-verify commits like it did before.

I didn't really think there was a significant cost to a skill so I had it write it up. If there is or this is just a me problem I can just leave it locally only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm, it appears mypy 2.0 and newer switched to SQLite (python/mypy#21041).

I've dived into possible causes a bit, and most likely this is related to how we call mypy from pre-commit hooks. python/mypy#13916 has some good hints how to call mypy best.

I've come up with a new PR to address this: #6977. I think with that this skill should not be required anymore.

description: >-
Diagnose and fix mypy pre-commit failures in this repo. Use when: mypy hook
crashes with INTERNAL ERROR, mypy exits with code 2, mypy fails silently, or
you suspect mypy cache corruption after seeing sqlite3 DatabaseError.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm, it appears mypy 2.0 and newer switched to SQLite (python/mypy#21041).

I've dived into possible causes a bit, and most likely this is related to how we call mypy from pre-commit hooks. python/mypy#13916 has some good hints how to call mypy best.

I've come up with a new PR to address this: #6977. I think with that this skill should not be required anymore.

@home-assistant home-assistant Bot marked this pull request as draft June 25, 2026 13:16
@home-assistant

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@mdegat01

Copy link
Copy Markdown
Contributor Author

Ok. Lets just leave this in draft for a bit to see if that addresses it, if so we can close. Also I don't mind just having this as a local skill if this is something I have to deal with a bunch but no one else does. I just want copilot to stop doing so many no-verify commits 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Other changes that don't modify src or test files cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants