Skip to content

Commit 3fd63c2

Browse files
authored
Release v1.3.2 (#24)
* Add note * Update changelog * remove hack.py * bump version and line length * Move setuptools section * readme tweaks * readme tweaks
1 parent 5665c4f commit 3fd63c2

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,6 @@ cython_debug/
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
#.idea/
163163

164-
.vscode/
164+
.vscode/
165+
166+
hack.py

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@ Several HTTP errors are often transient, and might succeed if retried:
1919

2020
This project aims to simplify retrying these, by extending [`tenacity`](https://tenacity.readthedocs.io/) with custom retry and wait strategies, as well as a custom decorator. Defaults are sensible for most use cases, but are fully customizable.
2121

22-
Supports exceptions raised by both [`requests`](https://docs.python-requests.org/en/latest/index.html) and [`httpx`](https://python-httpx.org/).
22+
Supports both [`requests`](https://docs.python-requests.org/en/latest/index.html) and [`httpx`](https://python-httpx.org/) natively, but could be customized to use with any library that raises exceptions for the conditions listed above.
2323

2424
## Install
2525

2626
Install from PyPI:
2727

2828
```sh
29-
# Supports both HTTPX and requests
30-
pip install retryhttp
29+
pip install retryhttp # Supports both HTTPX and requests
3130
```
3231

33-
You can also install support for only HTTPX or requests:
32+
You can also install support for only HTTPX or requests, if you would rather not install unnecessary dependencies:
3433

3534
```sh
36-
pip install retryhttp[httpx] # Supports only HTTPX
37-
pip install retryhttp[requests] # Supports only requests
35+
pip install retryhttp[httpx] # Supports only HTTPX
36+
pip install retryhttp[requests] # Supports only requests
3837
```
3938

4039
Or, install the latest development snapshot from git:
@@ -49,8 +48,8 @@ pip install git+https://github.com/austind/retryhttp.git@develop
4948
import httpx
5049
from retryhttp import retry
5150

52-
# Retries retryable status codes (429, 500, 502, 503, 504), network errors,
53-
# and timeouts, up to 3 times, with appropriate wait strategies for each
51+
# Retries safely retryable status codes (429, 500, 502, 503, 504), network errors,
52+
# and timeouts, up to a total of 3 times, with appropriate wait strategies for each
5453
# type of error. All of these behaviors are customizable.
5554
@retry
5655
def example():
@@ -62,4 +61,4 @@ def example():
6261

6362
## Contributing
6463

65-
Contributions welcome! Open a discussion and let's chat about your idea. Looking forward to working with you!
64+
Contributions welcome! Bug fixes and minor tweaks can jump straight to a [pull request](https://github.com/austind/retryhttp/compare). For more involved changes, [open an issue](https://github.com/austind/retryhttp/issues/new/choose) and let's chat about your idea. Thanks for your contribution!

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.3.2
4+
5+
* Bugfix: Don't pass `stop`, `wait`, and `retry` keyword arguments from [`retryhttp.retry`][] on to `tenacity.retry()` ([#23](https://github.com/austind/retryhttp/issues/23))
6+
37
## v1.3.1
48

59
* Fixed all outstanding mypy errors. ([#20](https://github.com/austind/retryhttp/issues/20)

docs/guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def get_example():
5353
response.raise_for_status()
5454
```
5555

56+
!!! note
57+
`retryhttp` works by catching exceptions, so your code must raise those exceptions. Most of the time, all you need is to call `response.raise_for_status()`. Be sure not to catch those exceptions in your own `try..except` block.
58+
5659
## Advanced Usage
5760

5861
You don't have to use the [`retryhttp.retry`][] decorator, which is provided purely for convenience. If you prefer, you can use [`tenacity.retry`](https://tenacity.readthedocs.io/en/latest/api.html#tenacity.retry) and roll your own approach.

pyproject.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
[build-system]
2-
# Minimum requirements for the build system to execute.
3-
# PEP 508 specifications for PEP 518.
4-
# Banned setuptools versions have well-known issues
5-
requires = [
6-
"setuptools >= 21.0.0,!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0", # PSF/ZPL
7-
"setuptools_scm[toml]>=3.4",
8-
]
9-
build-backend="setuptools.build_meta"
101

112
[project]
123
name = "retryhttp"
13-
version = "1.3.1"
4+
version = "1.3.2"
145
description = "Retry potentially transient HTTP errors in Python."
156
license = {file = "LICENSE"}
167
readme = "README.md"
@@ -75,11 +66,21 @@ Homepage = "https://github.com/austind/retryhttp"
7566
Repository = "https://github.com/austind/retryhttp.git"
7667
Issues = "https://github.com/austind/retryhttp/issues"
7768

69+
[build-system]
70+
# Minimum requirements for the build system to execute.
71+
# PEP 508 specifications for PEP 518.
72+
# Banned setuptools versions have well-known issues
73+
requires = [
74+
"setuptools >= 21.0.0,!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0", # PSF/ZPL
75+
"setuptools_scm[toml]>=3.4",
76+
]
77+
build-backend="setuptools.build_meta"
78+
7879
[tool.setuptools]
7980
packages = ["retryhttp"]
8081

8182
[tool.ruff]
82-
line-length = 88
83+
line-length = 100
8384
indent-width = 4
8485
target-version = "py38"
8586

0 commit comments

Comments
 (0)