Tenacity is a Python library (hosted on GitHub) for adding retry logic to code. It’s useful when you need operations to automatically retry after failures, typically to make programs more resilient to transient errors.
Project status
- Actively maintained, with an upstream GitHub push on 2026-10-07 and a recent PyPI update on 2026-10-07 (9.2.1), plus additional notable updates in 2026 (9.2.0 on 2026-08-05).
- Apparent update cadence is fairly regular, roughly every 1 to 2 months in 2026 (from 9.1.4 in early February to 9.2.0 in early August, then 9.2.1 one day after an upstream push in October).
AI summary generated
Recent updates
9.2.1
Release 9.2.1 publishes 9.2.0’s unreleased changes to PyPI and includes multiple bug fixes around retry execution. The main behavior changes address how Tenacity handles enabled=False on direct calls, falsy wait strategies and callable wait combinations, and ensuring Tornado availability is detected from a live global. It also fixes the PyPI long-description metadata so uploads no longer fail.
9.2.0
Tenacity 9.2.0 focuses on retry behavior and logging correctness, along with broad typing, linting, and CI/build workflow modernization. User-visible additions include Retrying/Retry decorators supporting a more informative name and an enabled flag to disable retrying, plus enhancements to wait_exponential_jitter (min and timedelta support, with initial deprecated).
Features9.1.4
Release 9.1.4 is a small, typing-focused patch for Tenacity. It improves the `@retry` decorator annotations for async `sleep=` callables, especially cases like `sleep=trio.sleep`, and does not appear to change runtime retry behavior.
9.1.3
Release 9.1.3 adds the new `wait_exception` wait strategy, adds Python 3.14 support, and drops Python 3.9. It also fixes async retry behavior when an async sleep callable is used with a synchronous function, and broadens logger typing for the logging helpers.
BreakingFeatures9.1.2
Release 9.1.2 appears to be a maintenance release with no substantive documented notes. The only code change is in the GitHub release workflow, where the package is now explicitly built into source and wheel distributions before publishing to PyPI.
9.1.1
Release 9.1.1 is a small maintenance release focused on CI, packaging, and retry matcher behavior. It adds Python 3.13 testing, drops Python 3.8 support in packaging and test tooling, switches release publishing to GitHub trusted publishing, and updates retry helpers to work with compiled regular expressions and a more precise Self return type.
BreakingFeatures9.1.0
Release 9.1.0 was published on 2025-04-02. No release notes were provided by the publisher, so the changes in this version are not documented here and developer impact cannot be determined from the release notes alone.
9.0.0
Tenacity 9.0.0 is a small release focused on fixing `wait_random_exponential` so it respects the configured `min` value, plus a major-version bump to signal API breakage around the `statistics` attribute. The code changes are narrowly scoped, with the main behavior change in retry backoff calculation and additional tests to cover the new minimum-bound behavior.
Breaking8.5.0
Tenacity 8.5.0 is a focused fix release that restores the wrapped function's `retry` attribute so it points at the underlying retry controller again. The docs and tests now emphasize reading execution statistics from `function.statistics`, and patching `function.retry` for temporary behavior changes such as overriding `wait` or `stop`.
8.4.2
Tenacity 8.4.2 is a focused bugfix release aimed at preserving local contexts during retry handling, especially in reentrant or nested usage of the same decorated function. The implementation changes both sync and async retry wrappers to use a fresh retry copy on each invocation, and adds regression coverage for the issue.
8.4.1
This release is a packaging-only update for tenacity 8.4.1. It fixes the distribution configuration so the `tenacity.asyncio` subpackage is included in published release artifacts.
8.4.0
tenacity 8.4.0 adds first-class async retry strategy support and automatic Trio compatibility. The code diff shows a broader async refactor than the release notes spell out, including a new async retry module, async-aware callback handling, and improved coroutine detection.
Features8.3.0
Release 8.3.0 adds a new retry stop function, stop_before_delay, to allow returning early when the next sleep would exceed a configured delay budget. It also fixes the retry decorator behavior to preserve function defaults (__defaults__ and __kwdefaults__).
Features