Update aiohttp to 3.9.0b0 (#101627)

This commit is contained in:
Marc Mueller 2023-10-08 13:21:46 +02:00 committed by GitHub
parent 8c26f66a57
commit 3155e62510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 10 deletions

View file

@ -156,9 +156,8 @@ class HassIOView(HomeAssistantView):
# _stored_content_type is only computed once `content_type` is accessed # _stored_content_type is only computed once `content_type` is accessed
if path == "backups/new/upload": if path == "backups/new/upload":
# We need to reuse the full content type that includes the boundary # We need to reuse the full content type that includes the boundary
headers[ # pylint: disable-next=protected-access
CONTENT_TYPE headers[CONTENT_TYPE] = request._stored_content_type # type: ignore[assignment]
] = request._stored_content_type # pylint: disable=protected-access
try: try:
client = await self._websession.request( client = await self._websession.request(

View file

@ -4,7 +4,6 @@ from __future__ import annotations
import asyncio import asyncio
from collections.abc import Awaitable, Callable from collections.abc import Awaitable, Callable
from contextlib import suppress from contextlib import suppress
from ssl import SSLContext
import sys import sys
from types import MappingProxyType from types import MappingProxyType
from typing import TYPE_CHECKING, Any, cast from typing import TYPE_CHECKING, Any, cast
@ -59,6 +58,17 @@ MAXIMUM_CONNECTIONS = 4096
MAXIMUM_CONNECTIONS_PER_HOST = 100 MAXIMUM_CONNECTIONS_PER_HOST = 100
# Overwrite base aiohttp _wait implementation
# Homeassistant has a custom shutdown wait logic.
async def _noop_wait(*args: Any, **kwargs: Any) -> None:
"""Do nothing."""
return
# pylint: disable-next=protected-access
web.BaseSite._wait = _noop_wait # type: ignore[method-assign]
class HassClientResponse(aiohttp.ClientResponse): class HassClientResponse(aiohttp.ClientResponse):
"""aiohttp.ClientResponse with a json method that uses json_loads by default.""" """aiohttp.ClientResponse with a json method that uses json_loads by default."""
@ -276,7 +286,7 @@ def _async_get_connector(
return cast(aiohttp.BaseConnector, hass.data[key]) return cast(aiohttp.BaseConnector, hass.data[key])
if verify_ssl: if verify_ssl:
ssl_context: bool | SSLContext = ssl_util.get_default_context() ssl_context = ssl_util.get_default_context()
else: else:
ssl_context = ssl_util.get_default_no_verify_context() ssl_context = ssl_util.get_default_no_verify_context()

View file

@ -1,5 +1,5 @@
aiodiscover==1.5.1 aiodiscover==1.5.1
aiohttp==3.8.6 aiohttp==3.9.0b0
aiohttp_cors==0.7.0 aiohttp_cors==0.7.0
astral==2.2 astral==2.2
async-upnp-client==0.36.1 async-upnp-client==0.36.1

View file

@ -23,7 +23,7 @@ classifiers = [
] ]
requires-python = ">=3.11.0" requires-python = ">=3.11.0"
dependencies = [ dependencies = [
"aiohttp==3.8.6", "aiohttp==3.9.0b0",
"astral==2.2", "astral==2.2",
"attrs==23.1.0", "attrs==23.1.0",
"atomicwrites-homeassistant==1.4.1", "atomicwrites-homeassistant==1.4.1",

View file

@ -1,7 +1,7 @@
-c homeassistant/package_constraints.txt -c homeassistant/package_constraints.txt
# Home Assistant Core # Home Assistant Core
aiohttp==3.8.6 aiohttp==3.9.0b0
astral==2.2 astral==2.2
attrs==23.1.0 attrs==23.1.0
atomicwrites-homeassistant==1.4.1 atomicwrites-homeassistant==1.4.1

View file

@ -164,7 +164,7 @@ async def test_limit_refetch(
hass.states.async_set("sensor.temp", "5") hass.states.async_set("sensor.temp", "5")
with pytest.raises(aiohttp.ServerTimeoutError), patch( with pytest.raises(aiohttp.ServerTimeoutError), patch(
"async_timeout.timeout", side_effect=asyncio.TimeoutError() "asyncio.timeout", side_effect=asyncio.TimeoutError()
): ):
resp = await client.get("/api/camera_proxy/camera.config_test") resp = await client.get("/api/camera_proxy/camera.config_test")

View file

@ -51,7 +51,7 @@ def test_serialize_body_str() -> None:
assert aiohttp.serialize_response(response) == { assert aiohttp.serialize_response(response) == {
"status": 201, "status": 201,
"body": "Hello", "body": "Hello",
"headers": {"Content-Length": "5", "Content-Type": "text/plain; charset=utf-8"}, "headers": {"Content-Type": "text/plain; charset=utf-8"},
} }