diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 81d219b8ad3..2deba3f4d1d 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -95,3 +95,7 @@ pytest_asyncio==1000000000.0.0 # https://github.com/jkeljo/sisyphus-control/issues/6 python-engineio>=3.13.1,<4.0 python-socketio>=4.6.0,<5.0 + +# Constrain multidict to avoid typing issues +# https://github.com/home-assistant/core/pull/64792 +multidict<6.0.0 diff --git a/homeassistant/util/aiohttp.py b/homeassistant/util/aiohttp.py index 765a9994a67..aa1aea1abc3 100644 --- a/homeassistant/util/aiohttp.py +++ b/homeassistant/util/aiohttp.py @@ -44,13 +44,13 @@ class MockRequest: self.method = method self.url = url self.status = status - self.headers: CIMultiDict[str, str] = CIMultiDict(headers or {}) + self.headers: CIMultiDict[str] = CIMultiDict(headers or {}) self.query_string = query_string or "" self._content = content self.mock_source = mock_source @property - def query(self) -> MultiDict[str, str]: + def query(self) -> MultiDict[str]: """Return a dictionary with the query variables.""" return MultiDict(parse_qsl(self.query_string, keep_blank_values=True)) @@ -68,7 +68,7 @@ class MockRequest: """Return the body as JSON.""" return json.loads(self._text) - async def post(self) -> MultiDict[str, str]: + async def post(self) -> MultiDict[str]: """Return POST parameters.""" return MultiDict(parse_qsl(self._text, keep_blank_values=True)) diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 952bd8b8f48..bfba8bddd43 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -120,6 +120,10 @@ pytest_asyncio==1000000000.0.0 # https://github.com/jkeljo/sisyphus-control/issues/6 python-engineio>=3.13.1,<4.0 python-socketio>=4.6.0,<5.0 + +# Constrain multidict to avoid typing issues +# https://github.com/home-assistant/core/pull/64792 +multidict<6.0.0 """ IGNORE_PRE_COMMIT_HOOK_ID = (