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

Fix typing, use ClientTimeout instead of float, bump aiohttp dependency to 3.3.0+ #163

Merged
merged 4 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/antsibull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions changelogs/fragments/163-aiohttp-timeout.yml
Original file line number Diff line number Diff line change
@@ -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)."
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/antsibull_core/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down