From 739eae185dcc27f27d59cea96d0bb3422d1cc880 Mon Sep 17 00:00:00 2001 From: Yannic Labonte Date: Thu, 9 May 2024 22:40:01 +0200 Subject: [PATCH] Add TimeoutException and update some dev dependencies --- README.md | 3 ++- pyproject.toml | 2 +- requirements.txt | 5 +++-- src/proconip/api.py | 6 +++++- src/setup.py | 2 +- tests/requirements.txt | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e4ea169..1999138 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,8 @@ output), there is a really simple way to support me: ## Release Notes -### In progress... +### v1.3.1 (2024-05-09) +* Add dedicated `api.TimeoutException` to raise for connection timeouts. * Add dependabot with `versioning-strategy: "increase"` and an auto-merge workflow for automated updates on the github `main` branch. * Add code scanning (CodeQL) workflow. diff --git a/pyproject.toml b/pyproject.toml index cefc7d9..3df0f95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "proconip" -version = "1.3.0" +version = "1.3.1" authors = [ { name="Yannic Labonte", email="yannic.labonte@gmail.com" }, ] diff --git a/requirements.txt b/requirements.txt index 4f87450..2db64d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -black >= 24.1 -setuptools >= 69.1 +black==24.4.2 +setuptools==69.5.1 +hatchling==1.24.2 \ No newline at end of file diff --git a/src/proconip/api.py b/src/proconip/api.py index bc412c8..cf49bff 100644 --- a/src/proconip/api.py +++ b/src/proconip/api.py @@ -246,7 +246,7 @@ async def async_start_dosage( response.raise_for_status() return await response.text() except asyncio.TimeoutError as exception: - raise ProconipApiException( + raise TimeoutException( "Timeout error fetching data", ) from exception except (ClientError, socket.gaierror) as exception: @@ -317,3 +317,7 @@ class BadCredentialsException(ProconipApiException): class BadStatusCodeException(ProconipApiException): """Exception to raise when we get an unknown response code.""" + + +class TimeoutException(ProconipApiException): + """Exception to raise when the connection times out.""" diff --git a/src/setup.py b/src/setup.py index 4e36f73..c5bc74d 100644 --- a/src/setup.py +++ b/src/setup.py @@ -8,4 +8,4 @@ "yarl>=1.9", ] -setup(name="proconip", version="1.3.0", packages=find_packages()) +setup(name="proconip", version="1.3.1", packages=find_packages()) diff --git a/tests/requirements.txt b/tests/requirements.txt index b8d8bff..9777947 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -aiohttp >= 3.9 +aiohttp==3.9.5 async-timeout >= 4.0 yarl >= 1.9 --editable src