Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mypy-dev to 1.12.0a3 #124939

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _enable_posix_spawn() -> None:
# less efficient. This is a workaround to force posix_spawn()
# when using musl since cpython is not aware its supported.
tag = next(packaging.tags.sys_tags())
subprocess._USE_POSIX_SPAWN = "musllinux" in tag.platform # noqa: SLF001
subprocess._USE_POSIX_SPAWN = "musllinux" in tag.platform # type: ignore[misc] # noqa: SLF001


def run(runtime_config: RuntimeConfig) -> int:
Expand Down
7 changes: 6 additions & 1 deletion homeassistant/util/frozen_dataclass_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

import dataclasses
import sys
from typing import Any, dataclass_transform
from typing import TYPE_CHECKING, Any, cast, dataclass_transform

if TYPE_CHECKING:
from _typeshed import DataclassInstance


def _class_fields(cls: type, kw_only: bool) -> list[tuple[str, Any, Any]]:
Expand Down Expand Up @@ -111,6 +114,8 @@ def __new__(*args: Any, **kwargs: Any) -> object:
"""
cls, *_args = args
if dataclasses.is_dataclass(cls):
if TYPE_CHECKING:
cls = cast(type[DataclassInstance], cls)
return object.__new__(cls)
return cls._dataclass(*_args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ astroid==3.2.4
coverage==7.6.0
freezegun==1.5.1
mock-open==1.4.0
mypy-dev==1.12.0a2
mypy-dev==1.12.0a3
pre-commit==3.7.1
pydantic==1.10.17
pylint==3.2.6
Expand Down
Loading