Bump pydantic to 2.10.3 and update required deps (#131963)

This commit is contained in:
J. Nick Koston
2024-12-10 18:27:40 +01:00
committed by GitHub
parent f99239538c
commit d2303eb83f
21 changed files with 48 additions and 77 deletions
-27
View File
@@ -197,33 +197,6 @@ jobs:
split -l $(expr $(expr $(cat requirements_all.txt | wc -l) + 1) / 3) requirements_all_wheels_${{ matrix.arch }}.txt requirements_all.txt
- name: Create requirements for cython<3
if: matrix.abi == 'cp312'
run: |
# Some dependencies still require 'cython<3'
# and don't yet use isolated build environments.
# Build these first.
# pydantic: https://github.com/pydantic/pydantic/issues/7689
touch requirements_old-cython.txt
cat homeassistant/package_constraints.txt | grep 'pydantic==' >> requirements_old-cython.txt
- name: Build wheels (old cython)
uses: home-assistant/wheels@2024.11.0
if: matrix.abi == 'cp312'
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;charset-normalizer;grpcio;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_old-cython.txt"
pip: "'cython<3'"
- name: Build wheels (part 1)
uses: home-assistant/wheels@2024.11.0
with:
@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/aussie_broadband",
"iot_class": "cloud_polling",
"loggers": ["aussiebb"],
"requirements": ["pyaussiebb==0.0.15"]
"requirements": ["pyaussiebb==0.1.4"]
}
@@ -137,7 +137,7 @@ VALID_MEDIA_TYPES: Final[tuple] = (
# Fallback sources to use in case of API failure.
FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
items=[
Source(
Source( # type: ignore[call-arg]
id="uriStreamer",
is_enabled=True,
is_playable=True,
@@ -145,7 +145,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="uriStreamer"),
is_seekable=False,
),
Source(
Source( # type: ignore[call-arg]
id="bluetooth",
is_enabled=True,
is_playable=True,
@@ -153,7 +153,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="bluetooth"),
is_seekable=False,
),
Source(
Source( # type: ignore[call-arg]
id="spotify",
is_enabled=True,
is_playable=True,
@@ -161,7 +161,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="spotify"),
is_seekable=True,
),
Source(
Source( # type: ignore[call-arg]
id="lineIn",
is_enabled=True,
is_playable=True,
@@ -169,7 +169,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="lineIn"),
is_seekable=False,
),
Source(
Source( # type: ignore[call-arg]
id="spdif",
is_enabled=True,
is_playable=True,
@@ -177,7 +177,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="spdif"),
is_seekable=False,
),
Source(
Source( # type: ignore[call-arg]
id="netRadio",
is_enabled=True,
is_playable=True,
@@ -185,7 +185,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="netRadio"),
is_seekable=False,
),
Source(
Source( # type: ignore[call-arg]
id="deezer",
is_enabled=True,
is_playable=True,
@@ -193,7 +193,7 @@ FALLBACK_SOURCES: Final[SourceArray] = SourceArray(
type=SourceTypeEnum(value="deezer"),
is_seekable=True,
),
Source(
Source( # type: ignore[call-arg]
id="tidalConnect",
is_enabled=True,
is_playable=True,
@@ -42,7 +42,7 @@ class BangOlufsenBase:
# Objects that get directly updated by notifications.
self._playback_metadata: PlaybackContentMetadata = PlaybackContentMetadata()
self._playback_progress: PlaybackProgress = PlaybackProgress(total_duration=0)
self._playback_progress: PlaybackProgress = PlaybackProgress(total_duration=0) # type: ignore[call-arg]
self._playback_source: Source = Source()
self._playback_state: RenderingState = RenderingState()
self._source_change: Source = Source()
@@ -210,9 +210,9 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
# Misc. variables.
self._audio_sources: dict[str, str] = {}
self._media_image: Art = Art()
self._software_status: SoftwareUpdateStatus = SoftwareUpdateStatus(
self._software_status: SoftwareUpdateStatus = SoftwareUpdateStatus( # type: ignore[call-arg]
software_version="",
state=SoftwareUpdateState(seconds_remaining=0, value="idle"),
state=SoftwareUpdateState(seconds_remaining=0, value="idle"), # type: ignore[call-arg]
)
self._sources: dict[str, str] = {}
self._state: str = MediaPlayerState.IDLE
@@ -896,9 +896,9 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
elif media_type == BangOlufsenMediaType.RADIO:
await self._client.run_provided_scene(
scene_properties=SceneProperties(
scene_properties=SceneProperties( # type: ignore[call-arg]
action_list=[
Action(
Action( # type: ignore[call-arg]
type="radio",
radio_station_id=media_id,
)
@@ -919,7 +919,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
deezer_id = kwargs[ATTR_MEDIA_EXTRA]["id"]
await self._client.start_deezer_flow(
user_flow=UserFlow(user_id=deezer_id)
user_flow=UserFlow(user_id=deezer_id) # type: ignore[call-arg]
)
# Play a playlist or album.
@@ -929,7 +929,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
start_from = kwargs[ATTR_MEDIA_EXTRA]["start_from"]
await self._client.add_to_queue(
play_queue_item=PlayQueueItem(
play_queue_item=PlayQueueItem( # type: ignore[call-arg]
provider=PlayQueueItemType(value=media_type),
start_now_from_position=start_from,
type="playlist",
@@ -940,7 +940,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
# Play a track.
else:
await self._client.add_to_queue(
play_queue_item=PlayQueueItem(
play_queue_item=PlayQueueItem( # type: ignore[call-arg]
provider=PlayQueueItemType(value=media_type),
start_now_from_position=0,
type="track",
+2 -2
View File
@@ -277,10 +277,10 @@ async def async_setup_add_event_service(
elif EVENT_START_DATETIME in call.data and EVENT_END_DATETIME in call.data:
start_dt = call.data[EVENT_START_DATETIME]
end_dt = call.data[EVENT_END_DATETIME]
start = DateOrDatetime(
start = DateOrDatetime( # type: ignore[call-arg]
date_time=start_dt, timezone=str(hass.config.time_zone)
)
end = DateOrDatetime(date_time=end_dt, timezone=str(hass.config.time_zone))
end = DateOrDatetime(date_time=end_dt, timezone=str(hass.config.time_zone)) # type: ignore[call-arg]
if start is None or end is None:
raise ValueError(
+5 -5
View File
@@ -272,7 +272,7 @@ async def async_setup_entry(
entity_description.search,
)
else:
request_template = SyncEventsRequest(
request_template = SyncEventsRequest( # type: ignore[call-arg]
calendar_id=calendar_id,
start_time=dt_util.now() + SYNC_EVENT_MIN_TIME,
)
@@ -437,11 +437,11 @@ class GoogleCalendarEntity(
start: DateOrDatetime
end: DateOrDatetime
if isinstance(dtstart, datetime):
start = DateOrDatetime(
start = DateOrDatetime( # type: ignore[call-arg]
date_time=dt_util.as_local(dtstart),
timezone=str(dt_util.get_default_time_zone()),
)
end = DateOrDatetime(
end = DateOrDatetime( # type: ignore[call-arg]
date_time=dt_util.as_local(dtend),
timezone=str(dt_util.get_default_time_zone()),
)
@@ -543,8 +543,8 @@ async def async_create_event(entity: GoogleCalendarEntity, call: ServiceCall) ->
elif EVENT_START_DATETIME in call.data and EVENT_END_DATETIME in call.data:
start_dt = call.data[EVENT_START_DATETIME]
end_dt = call.data[EVENT_END_DATETIME]
start = DateOrDatetime(date_time=start_dt, timezone=str(hass.config.time_zone))
end = DateOrDatetime(date_time=end_dt, timezone=str(hass.config.time_zone))
start = DateOrDatetime(date_time=start_dt, timezone=str(hass.config.time_zone)) # type: ignore[call-arg]
end = DateOrDatetime(date_time=end_dt, timezone=str(hass.config.time_zone)) # type: ignore[call-arg]
if start is None or end is None:
raise ValueError("Missing required fields to set start or end date/datetime")
@@ -131,7 +131,7 @@ class CalendarQueryUpdateCoordinator(DataUpdateCoordinator[list[Event]]):
self, start_date: datetime, end_date: datetime
) -> Iterable[Event]:
"""Get all events in a specific time frame."""
request = ListEventsRequest(
request = ListEventsRequest( # type: ignore[call-arg]
calendar_id=self.calendar_id,
start_time=start_date,
end_time=end_date,
@@ -149,7 +149,7 @@ class CalendarQueryUpdateCoordinator(DataUpdateCoordinator[list[Event]]):
async def _async_update_data(self) -> list[Event]:
"""Fetch data from API endpoint."""
request = ListEventsRequest(calendar_id=self.calendar_id, search=self._search)
request = ListEventsRequest(calendar_id=self.calendar_id, search=self._search) # type: ignore[call-arg]
try:
result = await self.calendar_service.async_list_events(request)
except ApiException as err:
@@ -37,7 +37,7 @@ async def async_get_config_entry_diagnostics(
return async_redact_data(
{
"entry": entry.as_dict(),
"data": coordinator.data.dict(),
"data": coordinator.data.dict(), # type: ignore[deprecated]
},
TO_REDACT,
)
@@ -5,5 +5,5 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/purpleair",
"iot_class": "cloud_polling",
"requirements": ["aiopurpleair==2022.12.1"]
"requirements": ["aiopurpleair==2023.12.0"]
}
@@ -6,7 +6,7 @@ import asyncio
import functools
from typing import Any, cast
from pydantic import ValidationError
from pydantic.v1 import ValidationError
from uiprotect.api import ProtectApiClient
from uiprotect.data import Camera, Chime
from uiprotect.exceptions import ClientError
+1 -1
View File
@@ -6,5 +6,5 @@
"dependencies": ["auth", "application_credentials"],
"documentation": "https://www.home-assistant.io/integrations/xbox",
"iot_class": "cloud_polling",
"requirements": ["xbox-webapi==2.0.11"]
"requirements": ["xbox-webapi==2.1.0"]
}
@@ -5,7 +5,7 @@ from __future__ import annotations
from collections.abc import Callable
import functools
from pydantic import ValidationError
from pydantic.v1 import ValidationError
import voluptuous as vol
from zwave_js_server.client import Client
from zwave_js_server.model.controller import CONTROLLER_EVENT_MODEL_MAP
+2 -3
View File
@@ -125,9 +125,8 @@ multidict>=6.0.2
# Version 2.0 added typing, prevent accidental fallbacks
backoff>=2.0
# Required to avoid breaking (#101042).
# v2 has breaking changes (#99218).
pydantic==1.10.19
# ensure pydantic version does not float since it might have breaking changes
pydantic==2.10.3
# Required for Python 3.12.4 compatibility (#119223).
mashumaro>=3.13.1
+3 -3
View File
@@ -328,7 +328,7 @@ aiopegelonline==0.1.0
aiopulse==0.4.6
# homeassistant.components.purpleair
aiopurpleair==2022.12.1
aiopurpleair==2023.12.0
# homeassistant.components.hunterdouglas_powerview
aiopvapi==3.1.1
@@ -1781,7 +1781,7 @@ pyatmo==8.1.0
pyatv==0.16.0
# homeassistant.components.aussie_broadband
pyaussiebb==0.0.15
pyaussiebb==0.1.4
# homeassistant.components.balboa
pybalboa==1.0.2
@@ -3020,7 +3020,7 @@ wolf-comm==0.0.15
wyoming==1.5.4
# homeassistant.components.xbox
xbox-webapi==2.0.11
xbox-webapi==2.1.0
# homeassistant.components.xiaomi_ble
xiaomi-ble==0.33.0
+1 -1
View File
@@ -14,7 +14,7 @@ license-expression==30.4.0
mock-open==1.4.0
mypy-dev==1.14.0a6
pre-commit==4.0.0
pydantic==1.10.19
pydantic==2.10.3
pylint==3.3.2
pylint-per-file-ignores==1.3.2
pipdeptree==2.23.4
+3 -3
View File
@@ -310,7 +310,7 @@ aiopegelonline==0.1.0
aiopulse==0.4.6
# homeassistant.components.purpleair
aiopurpleair==2022.12.1
aiopurpleair==2023.12.0
# homeassistant.components.hunterdouglas_powerview
aiopvapi==3.1.1
@@ -1455,7 +1455,7 @@ pyatmo==8.1.0
pyatv==0.16.0
# homeassistant.components.aussie_broadband
pyaussiebb==0.0.15
pyaussiebb==0.1.4
# homeassistant.components.balboa
pybalboa==1.0.2
@@ -2415,7 +2415,7 @@ wolf-comm==0.0.15
wyoming==1.5.4
# homeassistant.components.xbox
xbox-webapi==2.0.11
xbox-webapi==2.1.0
# homeassistant.components.xiaomi_ble
xiaomi-ble==0.33.0
+2 -3
View File
@@ -158,9 +158,8 @@ multidict>=6.0.2
# Version 2.0 added typing, prevent accidental fallbacks
backoff>=2.0
# Required to avoid breaking (#101042).
# v2 has breaking changes (#99218).
pydantic==1.10.19
# ensure pydantic version does not float since it might have breaking changes
pydantic==2.10.3
# Required for Python 3.12.4 compatibility (#119223).
mashumaro>=3.13.1
@@ -30,7 +30,7 @@ async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
),
patch(
"lacrosse_view.LaCrosse.get_locations",
return_value=[Location(id=1, name="Test")],
return_value=[Location(id="1", name="Test")],
),
):
result2 = await hass.config_entries.flow.async_configure(
@@ -206,7 +206,7 @@ async def test_already_configured_device(
),
patch(
"lacrosse_view.LaCrosse.get_locations",
return_value=[Location(id=1, name="Test")],
return_value=[Location(id="1", name="Test")],
),
):
result2 = await hass.config_entries.flow.async_configure(
@@ -262,7 +262,7 @@ async def test_reauth(hass: HomeAssistant) -> None:
patch("lacrosse_view.LaCrosse.login", return_value=True),
patch(
"lacrosse_view.LaCrosse.get_locations",
return_value=[Location(id=1, name="Test")],
return_value=[Location(id="1", name="Test")],
),
):
result2 = await hass.config_entries.flow.async_configure(
+2 -2
View File
@@ -39,7 +39,7 @@ async def test_sensor_available(
"peco.PecoOutageApi.get_outage_totals",
return_value=OutageResults(
customers_out=123,
percent_customers_out=15.589,
percent_customers_out=15,
outage_count=456,
customers_served=789,
),
@@ -74,7 +74,7 @@ async def test_sensor_available(
"peco.PecoOutageApi.get_outage_count",
return_value=OutageResults(
customers_out=123,
percent_customers_out=15.589,
percent_customers_out=15,
outage_count=456,
customers_served=789,
),
@@ -4,7 +4,7 @@
'attributes': ReadOnlyDict({
'entity_picture': 'https://i.ytimg.com/vi/wysukDrMdqU/maxresdefault.jpg',
'friendly_name': 'Google for Developers Latest upload',
'published_at': datetime.datetime(2023, 5, 11, 0, 20, 46, tzinfo=datetime.timezone.utc),
'published_at': datetime.datetime(2023, 5, 11, 0, 20, 46, tzinfo=TzInfo(UTC)),
'video_id': 'wysukDrMdqU',
}),
'context': <ANY>,