From cb5a2c9076dce41a4ad8c52360461a1e6a3cee73 Mon Sep 17 00:00:00 2001 From: Jules Dejaeghere Date: Mon, 5 May 2025 22:58:41 +0200 Subject: [PATCH] Use built-in asyncio.timeout() --- irm_kmi_api/api.py | 3 +-- pyproject.toml | 5 ++--- requirements.txt | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/irm_kmi_api/api.py b/irm_kmi_api/api.py index 645f274..426a7a9 100644 --- a/irm_kmi_api/api.py +++ b/irm_kmi_api/api.py @@ -12,7 +12,6 @@ from typing import Dict, List from zoneinfo import ZoneInfo import aiohttp -import async_timeout from .pollen import PollenName, PollenLevel from .const import MAP_WARNING_ID_TO_SLUG as SLUG_MAP @@ -125,7 +124,7 @@ class IrmKmiApiClient: headers['If-None-Match'] = self._cache[url]['etag'] try: - async with async_timeout.timeout(60): + async with asyncio.timeout(60): response = await self._session.request( method=method, url=url, diff --git a/pyproject.toml b/pyproject.toml index 28a65bf..9a6b603 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,9 +16,8 @@ classifiers = [ ] keywords = ["weather", "weather-api", "netherlands", "weather-forecast", "pollen", "belgium", "luxembourg", "rain-radar"] dependencies = [ - "aiohttp>=3.11.0", - "async-timeout>=4.0.3", - "svgwrite>=1.4.3", + "aiohttp>=3.11.0,<4.0.0", + "svgwrite>=1.4.3,<2.0.0", ] requires-python = ">=3.12" diff --git a/requirements.txt b/requirements.txt index 5b11229..7fa6bca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -aiohttp>=3.11.0 -async-timeout>=4.0.3 -svgwrite>=1.4.3 \ No newline at end of file +aiohttp>=3.11.0,<4.0.0 +svgwrite>=1.4.3,<2.0.0 \ No newline at end of file