From 6133f6eb8f66ef28ffbaa563e0db724573126665 Mon Sep 17 00:00:00 2001 From: Austin de Coup-Crank Date: Tue, 6 Aug 2024 09:09:52 -0500 Subject: [PATCH] Add ChunkedEncodingError and bump to v1.0.0 --- docs/changelog.md | 5 +++++ pyproject.toml | 7 ++++--- retryhttp/_retry.py | 2 ++ retryhttp/_utils.py | 7 ++++++- retryhttp/_wait.py | 1 + 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 0d3dbe4..1d48fd6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,10 @@ # Changelog +## v1.0.0 + +* API is now stable. Any breaking changes will follow [SemVer](https://semver.org/) guidelines. +* Added `requests.exceptions.ChunkedEncodingError` to the list of default network errors. + ## v0.2.0 * Rename `retryhttp.retry_http_errors` to [`retryhttp.retry`][]. diff --git a/pyproject.toml b/pyproject.toml index e61d25c..28f82bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,8 +10,8 @@ build-backend="setuptools.build_meta" [project] name = "retryhttp" -version = "0.2.0" -description = "Retry potentially transient HTTP errors." +version = "1.0.0" +description = "Retry potentially transient HTTP errors in Python." license = {file = "LICENSE"} readme = "README.md" requires-python = ">=3.8" @@ -22,7 +22,7 @@ maintainers = [ {name = "Austin de Coup-Crank", email = "austindcc@gmail.com"}, ] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", @@ -33,6 +33,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Topic :: Internet :: WWW/HTTP", "Topic :: Utilities", ] dependencies = [ diff --git a/retryhttp/_retry.py b/retryhttp/_retry.py index 3126b52..36b2805 100644 --- a/retryhttp/_retry.py +++ b/retryhttp/_retry.py @@ -60,6 +60,7 @@ def retry( - `httpx.ReadError` - `httpx.WriteError` - `requests.ConnectionError` + - `requests.exceptions.ChunkedEncodingError` - Timeouts: - `httpx.TimeoutException` - `requests.Timeout` @@ -149,6 +150,7 @@ class retry_if_network_error(retry_if_exception_type): - `httpx.ReadError` - `httpx.WriteError` - `requests.ConnectionError` + - `requests.exceptions.ChunkedEncodingError` """ diff --git a/retryhttp/_utils.py b/retryhttp/_utils.py index ac80dda..e3d7e87 100644 --- a/retryhttp/_utils.py +++ b/retryhttp/_utils.py @@ -46,7 +46,12 @@ def get_default_network_errors() -> ( ] ) if _REQUESTS_INSTALLED: - exceptions.append(requests.ConnectionError) + exceptions.extend( + [ + requests.ConnectionError, + requests.exceptions.ChunkedEncodingError, + ] + ) return tuple(exceptions) diff --git a/retryhttp/_wait.py b/retryhttp/_wait.py index 168a43e..6d58814 100644 --- a/retryhttp/_wait.py +++ b/retryhttp/_wait.py @@ -80,6 +80,7 @@ class wait_context_aware(wait_base): - `httpx.ReadError` - `httpx.WriteError` - `requests.ConnectionError` + - `requests.exceptions.ChunkedEncodingError` timeouts: One or more exceptions that will trigger `wait_timeouts`. If omitted, defaults to: