Skip to content

Commit

Permalink
Bump aiohttp to 3.9.0rc0 for python 3.12 only (#103507)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
  • Loading branch information
bdraco and cdce8p committed Nov 15, 2023
1 parent e87ebbe commit 54c98f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
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

0 comments on commit 54c98f3

Please sign in to comment.