Compare commits

..

2 commits

Author SHA1 Message Date
fda9f74838
Fix timeout
Some checks failed
Run Python tests / Run tests (push) Has been cancelled
2025-05-05 23:04:47 +02:00
cb5a2c9076
Use built-in asyncio.timeout() 2025-05-05 22:59:31 +02:00
4 changed files with 6 additions and 10 deletions

View file

@ -12,7 +12,6 @@ from typing import Dict, List
from zoneinfo import ZoneInfo from zoneinfo import ZoneInfo
import aiohttp import aiohttp
import async_timeout
from .pollen import PollenName, PollenLevel from .pollen import PollenName, PollenLevel
from .const import MAP_WARNING_ID_TO_SLUG as SLUG_MAP 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'] headers['If-None-Match'] = self._cache[url]['etag']
try: try:
async with async_timeout.timeout(60): async with asyncio.timeout(60):
response = await self._session.request( response = await self._session.request(
method=method, method=method,
url=url, url=url,

View file

@ -6,7 +6,6 @@ import datetime
import logging import logging
from typing import List, Self from typing import List, Self
import async_timeout
from svgwrite import Drawing from svgwrite import Drawing
from svgwrite.animate import Animate from svgwrite.animate import Animate
from svgwrite.container import FONT_TEMPLATE from svgwrite.container import FONT_TEMPLATE
@ -186,7 +185,7 @@ class RainGraph:
for url in urls: for url in urls:
coroutines.append(self._api_client.get_image(url)) coroutines.append(self._api_client.get_image(url))
async with async_timeout.timeout(60): async with asyncio.timeout(60):
images_from_api = await asyncio.gather(*coroutines) images_from_api = await asyncio.gather(*coroutines)
_LOGGER.info(f"Just downloaded {len(images_from_api)} images") _LOGGER.info(f"Just downloaded {len(images_from_api)} images")

View file

@ -16,9 +16,8 @@ classifiers = [
] ]
keywords = ["weather", "weather-api", "netherlands", "weather-forecast", "pollen", "belgium", "luxembourg", "rain-radar"] keywords = ["weather", "weather-api", "netherlands", "weather-forecast", "pollen", "belgium", "luxembourg", "rain-radar"]
dependencies = [ dependencies = [
"aiohttp>=3.11.0", "aiohttp>=3.11.0,<4.0.0",
"async-timeout>=4.0.3", "svgwrite>=1.4.3,<2.0.0",
"svgwrite>=1.4.3",
] ]
requires-python = ">=3.12" requires-python = ">=3.12"

View file

@ -1,3 +1,2 @@
aiohttp>=3.11.0 aiohttp>=3.11.0,<4.0.0
async-timeout>=4.0.3 svgwrite>=1.4.3,<2.0.0
svgwrite>=1.4.3