Update mypy-dev to 1.12.0a5 (#127181)

* Update mypy-dev to 1.12.0a5

* Fix enable_incomplete_feature

* Fix vlc_telnet

* Fix deconz
This commit is contained in:
Marc Mueller 2024-10-02 12:00:59 +02:00 committed by GitHub
parent 21266e1c68
commit 4cd6813d16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 12 deletions

View file

@ -138,7 +138,7 @@ class DeconzDevice[_DeviceT: _DeviceType](DeconzBase[_DeviceT], Entity):
"""Return True if device is available.""" """Return True if device is available."""
if isinstance(self._device, PydeconzScene): if isinstance(self._device, PydeconzScene):
return self.hub.available return self.hub.available
return self.hub.available and self._device.reachable # type: ignore[union-attr] return self.hub.available and self._device.reachable
class DeconzSceneMixin(DeconzDevice[PydeconzScene]): class DeconzSceneMixin(DeconzDevice[PydeconzScene]):

View file

@ -175,13 +175,13 @@ class VlcDevice(MediaPlayerEntity):
# Fall back to filename. # Fall back to filename.
if data_info := data.get("data"): if data_info := data.get("data"):
self._attr_media_title = _get_str(data_info, "filename") media_title = _get_str(data_info, "filename")
# Strip out auth signatures if streaming local media # Strip out auth signatures if streaming local media
if (media_title := self.media_title) and ( if media_title and (pos := media_title.find("?authSig=")) != -1:
pos := media_title.find("?authSig=")
) != -1:
self._attr_media_title = media_title[:pos] self._attr_media_title = media_title[:pos]
else:
self._attr_media_title = media_title
@catch_vlc_errors @catch_vlc_errors
async def async_media_seek(self, position: float) -> None: async def async_media_seek(self, position: float) -> None:

View file

@ -8,7 +8,6 @@ platform = linux
plugins = pydantic.mypy plugins = pydantic.mypy
show_error_codes = true show_error_codes = true
follow_imports = normal follow_imports = normal
enable_incomplete_feature = NewGenericSyntax
local_partial_types = true local_partial_types = true
strict_equality = true strict_equality = true
no_implicit_optional = true no_implicit_optional = true

View file

@ -11,7 +11,7 @@ astroid==3.3.4
coverage==7.6.1 coverage==7.6.1
freezegun==1.5.1 freezegun==1.5.1
mock-open==1.4.0 mock-open==1.4.0
mypy-dev==1.12.0a3 mypy-dev==1.12.0a5
pre-commit==3.8.0 pre-commit==3.8.0
pydantic==1.10.18 pydantic==1.10.18
pylint==3.3.1 pylint==3.3.1

View file

@ -36,11 +36,9 @@ GENERAL_SETTINGS: Final[dict[str, str]] = {
"plugins": "pydantic.mypy", "plugins": "pydantic.mypy",
"show_error_codes": "true", "show_error_codes": "true",
"follow_imports": "normal", "follow_imports": "normal",
"enable_incomplete_feature": ", ".join( # noqa: FLY002 # "enable_incomplete_feature": ", ".join( # noqa: FLY002
[ # []
"NewGenericSyntax", # ),
]
),
# Enable some checks globally. # Enable some checks globally.
"local_partial_types": "true", "local_partial_types": "true",
"strict_equality": "true", "strict_equality": "true",