Skip to content

Commit

Permalink
Update mypy-dev to 1.12.0a3 (home-assistant#124939)
Browse files Browse the repository at this point in the history
* Update mypy-dev to 1.12.0a3

* Fix
  • Loading branch information
cdce8p authored Aug 31, 2024
1 parent 994c2eb commit 5cd8e4a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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

0 comments on commit 5cd8e4a

Please sign in to comment.