Skip to content

Commit

Permalink
bump aiohttp from 3.9.5 to 3.11.11 (#266)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Konstantin <konstantin.klein+github@hochfrequenz.de>
  • Loading branch information
hf-kklein and Konstantin authored Jan 12, 2025
1 parent a4a8369 commit 81231fa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
14 changes: 9 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#
# pip-compile pyproject.toml
#
aiohttp==3.9.5
aiohappyeyeballs==2.4.4
# via aiohttp
aiohttp==3.11.11
# via edi_energy_scraper (pyproject.toml)
aiosignal==1.3.1
aiosignal==1.3.2
# via aiohttp
annotated-types==0.7.0
# via pydantic
attrs==24.2.0
attrs==24.3.0
# via aiohttp
efoli==1.4.0
# via edi_energy_scraper (pyproject.toml)
Expand All @@ -27,8 +29,10 @@ multidict==6.1.0
# aiohttp
# yarl
propcache==0.2.1
# via yarl
pydantic==2.10.4
# via
# aiohttp
# yarl
pydantic==2.10.5
# via edi_energy_scraper (pyproject.toml)
pydantic-core==2.27.2
# via pydantic
Expand Down
4 changes: 3 additions & 1 deletion src/edi_energy_scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Awaitable, Union

import aiohttp
from aiohttp import ClientTimeout
from efoli import get_edifact_format_version
from more_itertools import chunked

Expand Down Expand Up @@ -40,12 +41,13 @@ def __init__(
self._root_dir = path_to_mirror_directory
self.tcp_connector = aiohttp.TCPConnector(limit_per_host=connection_limit)
self._session = aiohttp.ClientSession(connector=self.tcp_connector)
self._timeout = ClientTimeout(total=30.0)

async def get_documents_overview(self) -> list[Document]:
"""
download meta information about all available documents
"""
documents_response = await self._session.get(f"{self._root_url}/api/documents", timeout=5)
documents_response = await self._session.get(f"{self._root_url}/api/documents", timeout=self._timeout)
response_body = await documents_response.json()
response_model = ResponseModel.model_validate(response_body)
return response_model.data
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def test_download_file(tmp_path: Path) -> None:
assert actual.suffix == ".pdf"


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

0 comments on commit 81231fa

Please sign in to comment.