Fix local mypy workflow#48433
Conversation
|
Well, I'm pointing out at the problem and explaining why this happens. I agree it's likely not the best way to fix it. Mypy won't work without this typing information. Another option I see is install all packages from Or create |
|
I think that typing needs indeed https://github.com/home-assistant/core/blob/48c0cfb25c0d403506ac5fd0c68251712228e71f/tox.ini#L43 |
|
It will only work if we also add Right now Are you ok with adding Edit: It's actually already there, not sure why it didn't work before. Let me try again. |
|
Ok, I got it. The problem is not in It doesn't run tools from So let's run Note that After that: |
|
Hi 👋 |
frenck
left a comment
There was a problem hiding this comment.
Ok, I got it. The problem is not in pre-commit not being isntalled, it's in how pre-commit runs tools.
That seems incorrect. requirements_test_all.txt includes requirements_test.txt, which includes requirements_test_pre_commit.txt.
As shown in your initial screenshot, pre-commit was just working:
Please keep pre-commit in place.
|
@frenck I think you didn't get my explanation. Let me try again.
But
But this will result that So IMO it's better to run |

Proposed change
My workflow
Actual result
Expected result
Mypy finishes successfully.
Problem
xknxpackage with typing information is not installed.Explanation
pre-commitis not configured to runmypyfromtoxvenv: pre-commit/pre-commit#1309So let's run it directly as
pytest. Another option could be changingpre-commitconfig to usetoxvenv but then you won't be able to usepre-commitbeforetoxenvironments are setup.Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: