Skip to content

Commit

Permalink
Add ChunkedEncodingError and bump to v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
austind committed Aug 6, 2024
1 parent 6c70c36 commit 6133f6e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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`][].
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -22,7 +22,7 @@ maintainers = [
{name = "Austin de Coup-Crank", email = "[email protected]"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
Expand All @@ -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 = [
Expand Down
2 changes: 2 additions & 0 deletions retryhttp/_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def retry(
- `httpx.ReadError`
- `httpx.WriteError`
- `requests.ConnectionError`
- `requests.exceptions.ChunkedEncodingError`
- Timeouts:
- `httpx.TimeoutException`
- `requests.Timeout`
Expand Down Expand Up @@ -149,6 +150,7 @@ class retry_if_network_error(retry_if_exception_type):
- `httpx.ReadError`
- `httpx.WriteError`
- `requests.ConnectionError`
- `requests.exceptions.ChunkedEncodingError`
"""

Expand Down
7 changes: 6 additions & 1 deletion retryhttp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
1 change: 1 addition & 0 deletions retryhttp/_wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6133f6e

Please sign in to comment.