tenacity 8.5.0__py3-none-any.whl → 9.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tenacity/__init__.py CHANGED
@@ -76,7 +76,7 @@ from .before import before_nothing # noqa
76
76
  from .after import after_log # noqa
77
77
  from .after import after_nothing # noqa
78
78
 
79
- # Import all built-in after strategies for easier usage.
79
+ # Import all built-in before sleep strategies for easier usage.
80
80
  from .before_sleep import before_sleep_log # noqa
81
81
  from .before_sleep import before_sleep_nothing # noqa
82
82
 
@@ -88,6 +88,8 @@ except ImportError:
88
88
  if t.TYPE_CHECKING:
89
89
  import types
90
90
 
91
+ from typing_extensions import Self
92
+
91
93
  from . import asyncio as tasyncio
92
94
  from .retry import RetryBaseT
93
95
  from .stop import StopBaseT
@@ -255,7 +257,7 @@ class BaseRetrying(ABC):
255
257
  retry_error_callback: t.Union[
256
258
  t.Optional[t.Callable[["RetryCallState"], t.Any]], object
257
259
  ] = _unset,
258
- ) -> "BaseRetrying":
260
+ ) -> "Self":
259
261
  """Copy this object with some parameters changed if needed."""
260
262
  return self.__class__(
261
263
  sleep=_first_set(sleep, self.sleep),
tenacity/before_sleep.py CHANGED
@@ -25,7 +25,7 @@ if typing.TYPE_CHECKING:
25
25
 
26
26
 
27
27
  def before_sleep_nothing(retry_state: "RetryCallState") -> None:
28
- """Before call strategy that does nothing."""
28
+ """Before sleep strategy that does nothing."""
29
29
 
30
30
 
31
31
  def before_sleep_log(
@@ -33,7 +33,7 @@ def before_sleep_log(
33
33
  log_level: int,
34
34
  exc_info: bool = False,
35
35
  ) -> typing.Callable[["RetryCallState"], None]:
36
- """Before call strategy that logs to some logger the attempt."""
36
+ """Before sleep strategy that logs to some logger the attempt."""
37
37
 
38
38
  def log_it(retry_state: "RetryCallState") -> None:
39
39
  local_exc_info: BaseException | bool | None
tenacity/retry.py CHANGED
@@ -207,7 +207,7 @@ class retry_if_exception_message(retry_if_exception):
207
207
  def __init__(
208
208
  self,
209
209
  message: typing.Optional[str] = None,
210
- match: typing.Optional[str] = None,
210
+ match: typing.Union[None, str, typing.Pattern[str]] = None,
211
211
  ) -> None:
212
212
  if message and match:
213
213
  raise TypeError(
@@ -242,7 +242,7 @@ class retry_if_not_exception_message(retry_if_exception_message):
242
242
  def __init__(
243
243
  self,
244
244
  message: typing.Optional[str] = None,
245
- match: typing.Optional[str] = None,
245
+ match: typing.Union[None, str, typing.Pattern[str]] = None,
246
246
  ) -> None:
247
247
  super().__init__(message, match)
248
248
  # invert predicate
tenacity/wait.py CHANGED
@@ -197,7 +197,7 @@ class wait_random_exponential(wait_exponential):
197
197
 
198
198
  def __call__(self, retry_state: "RetryCallState") -> float:
199
199
  high = super().__call__(retry_state=retry_state)
200
- return random.uniform(0, high)
200
+ return random.uniform(self.min, high)
201
201
 
202
202
 
203
203
  class wait_exponential_jitter(wait_base):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: tenacity
3
- Version: 8.5.0
3
+ Version: 9.1.2
4
4
  Summary: Retry code until it succeeds
5
5
  Home-page: https://github.com/jd/tenacity
6
6
  Author: Julien Danjou
@@ -11,20 +11,21 @@ Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Programming Language :: Python
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Utilities
20
- Requires-Python: >=3.8
20
+ Requires-Python: >=3.9
21
21
  License-File: LICENSE
22
22
  Provides-Extra: doc
23
- Requires-Dist: reno ; extra == 'doc'
24
- Requires-Dist: sphinx ; extra == 'doc'
23
+ Requires-Dist: reno; extra == "doc"
24
+ Requires-Dist: sphinx; extra == "doc"
25
25
  Provides-Extra: test
26
- Requires-Dist: pytest ; extra == 'test'
27
- Requires-Dist: tornado >=4.5 ; extra == 'test'
28
- Requires-Dist: typeguard ; extra == 'test'
26
+ Requires-Dist: pytest; extra == "test"
27
+ Requires-Dist: tornado>=4.5; extra == "test"
28
+ Requires-Dist: typeguard; extra == "test"
29
+ Dynamic: license-file
29
30
 
30
31
  Tenacity is a general-purpose retrying library to simplify the task of adding retry behavior to just about anything.
@@ -1,18 +1,18 @@
1
- tenacity/__init__.py,sha256=VEqa73Lqmwd0kWnyf1nDCRvp4JthP9RwUiNQZmfnTTw,24021
1
+ tenacity/__init__.py,sha256=LLTmuzCs-hqXeQSVlAig6GwSCj3V1PewC9-b3mTXn1g,24060
2
2
  tenacity/_utils.py,sha256=5AwPoFrGOIfPkCtqeJdFBi7KKQNcJXJ3erbtGOXtn6w,2916
3
3
  tenacity/after.py,sha256=NR4rGyslG7xF1hDJZb2Wf8wVApafX0HZwz2nFVLvaqE,1658
4
4
  tenacity/before.py,sha256=7zDTpZ3b6rkY9sOdS-qbpjBgSjVr3xBqcIqdYAh9ZKM,1544
5
- tenacity/before_sleep.py,sha256=upKssiY5poOO3Bv0amADZA-a5CrY5tnb4_97s8_88SM,2360
5
+ tenacity/before_sleep.py,sha256=J8emgLL-jkzbctXE7uzEUfCxWL4SKfGuOmilWowCP9c,2362
6
6
  tenacity/nap.py,sha256=fRWvnz1aIzbIq9Ap3gAkAZgDH6oo5zxMrU6ZOVByq0I,1383
7
7
  tenacity/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- tenacity/retry.py,sha256=PVnZfXBeLN2DzsytKexw23SPLn82AdZfFPC2OhVQ_1Y,8986
8
+ tenacity/retry.py,sha256=cZrAzWmMqAORKjmz9B1Pq2Kvn9GX2Znzs_3ybgvQwnE,9034
9
9
  tenacity/stop.py,sha256=wQuwGfCLw8OH1C3x0G9lH9xtJCyhgviePQ40HRAUg54,4113
10
10
  tenacity/tornadoweb.py,sha256=vS1ONfPYoGzPx1asQaVbfoo6D9tPIzSysJipm61Yqw8,2125
11
- tenacity/wait.py,sha256=Q9XoZCtFra53aQOyfABpvRDuUeB-NpUUXImHsUiRQI0,8042
11
+ tenacity/wait.py,sha256=1oye0erAqJkSIysEQIfgtZXHunv7t31BwI2gHL1FsSk,8049
12
12
  tenacity/asyncio/__init__.py,sha256=PoDGzHN-neTr2GgA1Ti3ORMrSmUIEUblbiSiuyxKHTI,7773
13
13
  tenacity/asyncio/retry.py,sha256=ymu8F1JfAerc5vDO0V4-2kCvHXqyce2jpO1Nlt6aKxI,4244
14
- tenacity-8.5.0.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
15
- tenacity-8.5.0.dist-info/METADATA,sha256=8CBR9pYHoi3YV66CkCQE5wDLNlmR6YSyFezjWE9OQIo,1155
16
- tenacity-8.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
17
- tenacity-8.5.0.dist-info/top_level.txt,sha256=Zf8AOZMN7hr1EEcUo9U5KzXsM4TOC1pBZ22D8913JYs,9
18
- tenacity-8.5.0.dist-info/RECORD,,
14
+ tenacity-9.1.2.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
15
+ tenacity-9.1.2.dist-info/METADATA,sha256=1vPK9y_B7kDK-RNa33tdRKRRABFbTqkrgPGe0YOxV6U,1172
16
+ tenacity-9.1.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
17
+ tenacity-9.1.2.dist-info/top_level.txt,sha256=Zf8AOZMN7hr1EEcUo9U5KzXsM4TOC1pBZ22D8913JYs,9
18
+ tenacity-9.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5