diff --git a/.github/workflows/antsibull.yml b/.github/workflows/antsibull.yml index 13d74c3..0e5c45a 100644 --- a/.github/workflows/antsibull.yml +++ b/.github/workflows/antsibull.yml @@ -52,6 +52,12 @@ jobs: sed -e 's/pyre-check/pyre-check <= 0.9.20,/' -i pyproject.toml working-directory: antsibull + - name: Patch our pyproject.toml + # Necessary for pyre... + run: | + sed -e 's/aiohttp/aiohttp < 3.10.0,/' -i pyproject.toml + working-directory: antsibull-core + - name: Set up Python 3.12 id: python uses: actions/setup-python@v5 diff --git a/changelogs/fragments/163-aiohttp-timeout.yml b/changelogs/fragments/163-aiohttp-timeout.yml new file mode 100644 index 0000000..0b506df --- /dev/null +++ b/changelogs/fragments/163-aiohttp-timeout.yml @@ -0,0 +1,5 @@ +bugfixes: + - "Adjust the aiohttp retry GET mananger to use ``ClientTimeout`` instead of a ``float``, since that will be removed in aiohttp 4.0.0 + (https://github.com/ansible-community/antsibull-core/pull/163)." + - "Bump asyncio requirement to >= 3.3.0 instead of 3.0.0. Version 3.0.0 likely never worked with the retry code that + has been in here basically since he beginning (https://github.com/ansible-community/antsibull-core/pull/163)." diff --git a/pyproject.toml b/pyproject.toml index fecd5de..1b03dea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ requires-python = ">=3.9" dependencies = [ "aiofiles", - "aiohttp >= 3.0.0", + "aiohttp >= 3.3.0", "build", # major/minor was introduced here "packaging >= 20.0", diff --git a/src/antsibull_core/utils/http.py b/src/antsibull_core/utils/http.py index def0816..17b53a8 100644 --- a/src/antsibull_core/utils/http.py +++ b/src/antsibull_core/utils/http.py @@ -61,8 +61,8 @@ async def __aenter__(self) -> aiohttp.ClientResponse: flog.debug("Execute {0}", self.call_string) wait_factor: float = 5 try: - response = await self.aio_session.get( - *self.args, **self.kwargs, timeout=20 + response = await self.aio_session.get( # pyre-ignore[16] + *self.args, **self.kwargs, timeout=aiohttp.ClientTimeout(total=20) ) status_code = response.status flog.debug(f"Status code {status_code}")