New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update mypy to 1.6.0 #101780
Merged
Merged
Update mypy to 1.6.0 #101780
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
home-assistant
bot
added
cla-signed
dependency
dependency-bump
Hacktoberfest
small-pr
PRs with less than 30 lines.
labels
Oct 10, 2023
Sync typeshed (15792)
Sync typeshed (15792)
Mypy regression (16058)
cdce8p
force-pushed
the
update-mypy-1.6.0
branch
from
October 10, 2023 21:15
e21dd01
to
ab42401
Compare
cdce8p
requested review from
scop,
MartinHjelmare,
joostlek,
bdraco and
a team
as code owners
October 11, 2023 10:57
cdce8p
added
the
smash
Indicator this PR is close to finish for merging or closing
label
Oct 11, 2023
joostlek
approved these changes
Oct 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤馃徎 for media extractor
frenck
approved these changes
Oct 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @cdce8p 馃憤
../Frenck
MartinHjelmare
approved these changes
Oct 11, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cla-signed
dependency
dependency-bump
Hacktoberfest
small-pr
PRs with less than 30 lines.
smash
Indicator this PR is close to finish for merging or closing
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
https://mypy-lang.blogspot.com/2023/10/mypy-16-released.html
dict.get
was updated to better handledict[str, Any]
.Previously the resulting type of
get
with a default value would be the type of the default value itself even though it can still be the value type of the dict (i.e.Any
). The full workaround would be to use TypedDicts instead but this isn't always practical -> should not be done in this PR. Addedtype: ignore[no-any-return]
instead. See 1214cbfimport
error codes ->import-not-found
andimport-untyped
. Those allow for more precision than theignore_missing_imports = true
setting. For now, I've disabled both while removingignore_missing_imports
. In the long run, it might be possible to enable theimport-not-found
error code. Just not yet as it is also triggered for C-extensions without stub files. Mypy, in contrast to pylint, can't introspect those. See ab42401https://mypy.readthedocs.io/en/stable/error_code_list.html#check-for-an-issue-with-imports-import
https://mypy.readthedocs.io/en/stable/running_mypy.html#ignore-missing-imports
1.6.0
. Will be included in the next one. For now I've added a type ignore. See ae326f9Type 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
.To help with the load of incoming pull requests: