From 24c215ec516aa6cad85166a06f3413655a8ed3d5 Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Mon, 5 Aug 2024 21:53:07 +0200 Subject: [PATCH 1/2] Remove workarounds (HA-core updated to aiohttp 3.10.1 --- CHANGELOG.md | 4 ---- scripts/tests_and_coverage.sh | 3 --- 2 files changed, 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75e47820..f4fc193c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,5 @@ # Changelog -## ongoing - -- Note2self; remove aiohttp 3.10 test fixing in scripts/* and verify workflow - ## v0.38.3 - Implement fix for Core Issue [#119686](https://github.com/home-assistant/core/issues/119686) diff --git a/scripts/tests_and_coverage.sh b/scripts/tests_and_coverage.sh index 6949bbe06..b8dd17c9e 100755 --- a/scripts/tests_and_coverage.sh +++ b/scripts/tests_and_coverage.sh @@ -26,9 +26,6 @@ pre-commit install pre-commit install-hooks pip install uv uv pip install -r requirements_test.txt -r requirements_commit.txt -# TODO: Remove after update of aiohttp beyond 3.10.0 -# shellcheck disable=SC2015 -uv pip show aiohttp | grep -q "Version: 3.10.0" && (grep -q "core.locations" venv/lib/python*/site-packages/aiohttp/web_urldispatcher.py && echo " *** aiohttp already patched" || ( echo "Patching aiohttp 3.10.0 for tests"; patch -tRup0 venv/lib/python*/site-packages/aiohttp/web_urldispatcher.py < patch/aiohttp310.patch && echo " *** aiohttp Patched!" || echo " *** aiohttp patch failed?")) || ( echo " ***"; echo " *** WE CAN REMOVE THE PATCH FOR aiohttp 3.10.0 from $0"; echo " ***" ) set +u From cb887224e1e694f8e6bae97257b91560146aad96 Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Tue, 6 Aug 2024 09:10:54 +0200 Subject: [PATCH 2/2] Remove stale patches --- patch/aiohttp310.patch | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 patch/aiohttp310.patch diff --git a/patch/aiohttp310.patch b/patch/aiohttp310.patch deleted file mode 100644 index b67728026..000000000 --- a/patch/aiohttp310.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- venv/lib/python3.12/site-packages/aiohttp/web_urldispatcher.py 2024-08-01 13:01:32 -+++ /tmp/web_urldispatcher.py 2024-08-01 22:37:19 -@@ -1132,15 +1132,7 @@ - def _get_resource_index_key(self, resource: AbstractResource) -> str: - """Return a key to index the resource in the resource index.""" - # strip at the first { to allow for variables -- #return resource.canonical.partition("{")[0].rstrip("/") or "/" -- if "{" in (index_key := resource.canonical): -- # strip at the first { to allow for variables, and than -- # rpartition at / to allow for variable parts in the path -- # For example if the canonical path is `/core/locations{tail:.*}` -- # the index key will be `/core` since index is based on the -- # url parts split by `/` -- index_key = index_key.partition("{")[0].rpartition("/")[0] -- return index_key.rstrip("/") or "/" -+ return resource.canonical.partition("{")[0].rstrip("/") or "/" - - def index_resource(self, resource: AbstractResource) -> None: - """Add a resource to the resource index."""