Skip to content

Commit 81231fa

Browse files
hf-kkleinKonstantin
andauthored
bump aiohttp from 3.9.5 to 3.11.11 (#266)
--------- Co-authored-by: Konstantin <[email protected]>
1 parent a4a8369 commit 81231fa

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

requirements.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
#
55
# pip-compile pyproject.toml
66
#
7-
aiohttp==3.9.5
7+
aiohappyeyeballs==2.4.4
8+
# via aiohttp
9+
aiohttp==3.11.11
810
# via edi_energy_scraper (pyproject.toml)
9-
aiosignal==1.3.1
11+
aiosignal==1.3.2
1012
# via aiohttp
1113
annotated-types==0.7.0
1214
# via pydantic
13-
attrs==24.2.0
15+
attrs==24.3.0
1416
# via aiohttp
1517
efoli==1.4.0
1618
# via edi_energy_scraper (pyproject.toml)
@@ -27,8 +29,10 @@ multidict==6.1.0
2729
# aiohttp
2830
# yarl
2931
propcache==0.2.1
30-
# via yarl
31-
pydantic==2.10.4
32+
# via
33+
# aiohttp
34+
# yarl
35+
pydantic==2.10.5
3236
# via edi_energy_scraper (pyproject.toml)
3337
pydantic-core==2.27.2
3438
# via pydantic

src/edi_energy_scraper/scraper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Awaitable, Union
77

88
import aiohttp
9+
from aiohttp import ClientTimeout
910
from efoli import get_edifact_format_version
1011
from more_itertools import chunked
1112

@@ -40,12 +41,13 @@ def __init__(
4041
self._root_dir = path_to_mirror_directory
4142
self.tcp_connector = aiohttp.TCPConnector(limit_per_host=connection_limit)
4243
self._session = aiohttp.ClientSession(connector=self.tcp_connector)
44+
self._timeout = ClientTimeout(total=30.0)
4345

4446
async def get_documents_overview(self) -> list[Document]:
4547
"""
4648
download meta information about all available documents
4749
"""
48-
documents_response = await self._session.get(f"{self._root_url}/api/documents", timeout=5)
50+
documents_response = await self._session.get(f"{self._root_url}/api/documents", timeout=self._timeout)
4951
response_body = await documents_response.json()
5052
response_model = ResponseModel.model_validate(response_body)
5153
return response_model.data

unittests/test_downloads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async def test_download_file(tmp_path: Path) -> None:
6464
assert actual.suffix == ".pdf"
6565

6666

67-
def test_cleanup(tmp_path: Path) -> None:
67+
async def test_cleanup(tmp_path: Path) -> None: # test is async to avoid RuntimeError: no running event loop
6868
test_folder = tmp_path / "test"
6969
test_folder.mkdir()
7070
a_directory = test_folder / "adir"

0 commit comments

Comments
 (0)