Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Unfortunately, the mypy releases don't happen quite as regular as I would like. Usually that isn't a big issue, however this time the next version will include some features and bug fixes which are required for some major typing improvements.
The release itself was originally planned for the end of January, the release branch has even been cut already, unfortunately though there haven't been any updates over the last two weeks. It might happen early next week, or next month.
That's why I decided to create a project to build custom mypy version and upload them to PyPI. These can be used interchangeably which mypy itself, basically as a stop gap, until the next official release. The wheels are build using almost the same workflow, i.e. also compiled with mypyc. Only difference being that I chose not to compile / upload
musllinux
wheels. (If necessary, I can add that and push a new release.)https://pypi.org/project/mypy-dev/1.9.0b1/
https://github.com/cdce8p/mypy-dev/tree/1.9.0b1
https://github.com/cdce8p/mypy-dev/releases/tag/1.9.0b1
Release
1.9.0b1
tracks the current HEAD of therelease-1.9.0
branch python/mypy@155909a.Changes for Mypy 1.9.0 (incomplete)
DataUpdateCoordinator
.As long as the default isn't a TypeVarTuple or references another TypeVar.
=> This will also enable us to add generic typing to the
Event
class to get rid of sometype: ignores
aroundasync_listen
.Improve dispatcher typing #106872
Consider TypeVarTuple to be invariant python/mypy#16759
dict.__setitem__
with custom key types. Required foraiohttp.web.AppKey
andAdd HassDict implementation #103844
Fix missing type store for overloads python/mypy#16803
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
asyncio
callback types - anything with acallback
and only*args
, e.g.call_soon
. We could use something similar forasync_add_job
,async_add_hass_job
, ... .Plan for the future
As soon as there is an official release, I'll create a PR to use that one instead. Beyond that, if there is a similar situation in the future, it might make sense to temporarily switch again. So far, I don't expect that. This release is somewhat special as a lot of typing improvements are currently blocked.
Good to know
mypy --version
will print the development version as if mypy would have been installed from git. I.e. not1.9.0b1
but this insteadJust in case someone finds an issue and wants to open a bug report on the official mypy repo.
Refs
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: