Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump aiohttp to 3.9.0rc0 for python 3.12 only #103507

Merged
merged 12 commits into from
Nov 15, 2023
13 changes: 0 additions & 13 deletions homeassistant/helpers/aiohttp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@
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


# TODO: Remove version check with aiohttp 3.9.0 # pylint: disable=fixme
if sys.version_info >= (3, 12):
# pylint: disable-next=protected-access
web.BaseSite._wait = _noop_wait # type: ignore[method-assign]


class HassClientResponse(aiohttp.ClientResponse):
"""aiohttp.ClientResponse with a json method that uses json_loads by default."""

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ aiodiscover==1.5.1
aiohttp-fast-url-dispatcher==0.1.0
aiohttp-zlib-ng==0.1.1
aiohttp==3.8.5;python_version<'3.12'
aiohttp==3.9.0b0;python_version>='3.12'
aiohttp==3.9.0rc0;python_version>='3.12'
aiohttp_cors==0.7.0
astral==2.2
async-upnp-client==0.36.2
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
]
requires-python = ">=3.11.0"
dependencies = [
"aiohttp==3.9.0b0;python_version>='3.12'",
"aiohttp==3.9.0rc0;python_version>='3.12'",
"aiohttp==3.8.5;python_version<'3.12'",
"aiohttp_cors==0.7.0",
"aiohttp-fast-url-dispatcher==0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-c homeassistant/package_constraints.txt

# Home Assistant Core
aiohttp==3.9.0b0;python_version>='3.12'
aiohttp==3.9.0rc0;python_version>='3.12'
aiohttp==3.8.5;python_version<'3.12'
aiohttp_cors==0.7.0
aiohttp-fast-url-dispatcher==0.1.0
Expand Down
6 changes: 6 additions & 0 deletions tests/test_util/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def raise_for_status(self):
def close(self):
"""Mock close."""

async def wait_for_close(self):
"""Wait until all requests are done.

Do nothing as we are mocking.
"""

@property
def response(self):
"""Property method to expose the response to other read methods."""
Expand Down
Loading