Open
Conversation
* start_time == outcome_timestamp is possible * logging.Formatter uses explicitly hard-coded `\n` newlines (as opposed to using the platform-specific os.linesep)
...rather than sometimes allowing a default return of `None` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Slava Skvortsov <kondor1995@mail.ru>
* Fix iscoroutinefunction check (inspect & asyncio) * Add real async wrap & preserve retry attributes * Adjust to pep8 * Add test to ensure retryable_coroutine attributes * Fix `blank line contains whitespace` pep8 error
* chore: add missing noqa statements * docs: fix autoinstanceattribute
chore: add support for Python 3.9
* Copy whole internal state when retry_with (#233) Both `retry_error_cls` and `retry_error_callback` were missing from the copy, resulting in a copy that presents a different behavior than the original function. * Apply review feedback - define `_first_set` only once - get away with unittest - use pytest.raises
This should make sure we don't forget to put a release note before merging a PR. Related to #284
ci(mergify): force release notes to be present
Tweak Mergify config
* Make logger more compatible * Add release note * Fix black formatting * Ignore D402 error in flake8 * Update PR Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add retry_except_exception_type Fixes #256 * Apply suggestions from code review Co-authored-by: Julien Danjou <julien@danjou.info> * rename 'except' to 'if not' * fix test * rename again Co-authored-by: Julien Danjou <julien@danjou.info>
Drop support for deprecated Pythons
- Use `black` for code formatting and validate using `black --check`. Code compatibility: py26-py39. - Enforce maximal line length to 120 symbols
Use black instead of "flake8-black" on CI.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6.0.0...v6.0.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add missing closing bracket in the wait_chain docstring example code. Also fix the multi-line string in the print statement. Closes #250
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/checkout` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6.0.1...v6.0.2) Updates `actions/setup-python` from 6.1.0 to 6.2.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v6.1.0...v6.2.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/setup-python dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Remove Python 3.9 from CI matrix, setup.cfg classifiers, tox envlist, mergify checks, and bump python_requires to >=3.10. Inline code that was gated behind sys.version_info checks: - Use slots=True directly in dataclass decorator (3.10+) - Use futures.Future[t.Any] directly (3.9+) - Remove redundant version checks and imports in tests
* improve annotations * ruff format * fix for py311
The `find_ordinal` utility incorrectly assigned "st", "nd", and "rd" suffixes to numbers greater than 20 that end in 11, 12, or 13 (e.g., 111 became "111st"). This commit modifies the logic to check `pos_num % 100` for the 11–13 range before falling back to the modulo 10 recursion. This ensures consistent "th" suffixes for these edge cases (e.g., "111th", "112th"). New regression tests have been added to `tests/test_utils.py` to cover these scenarios.
Migrate test/task orchestration from tox to poethepoet (poe) + uv. - Switch build backend from setuptools to hatchling + hatch-vcs - Consolidate package metadata from setup.cfg into pyproject.toml (PEP 621) - Add PEP 735 dev dependency group with all dev tools - Define poe tasks: test, lint, mypy, docs, check, all, reno - Rewrite CI workflow to use astral-sh/setup-uv + uv run poe - Rewrite release workflow to use uv build - Update mergify check names and readthedocs config - Delete tox.ini, setup.cfg, setup.py - Add mypy as a required mergify check (was not blocking merges before) Change-Id: I2aed83b236aabcf3fc75e6681184cc5be1f2daad Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Replace dead CircleCI badge with GitHub Actions CI badge - Update PyPI badge to link to canonical pypi.org URL - Add Python versions badge Change-Id: I4b892182f065addebb2f03c454be421dfae09b14
Add Documentation, Source, Issues, and Changelog links to [project.urls]. These appear as sidebar links on PyPI. Change-Id: I5ed732058f92698c82d5ff7124d92a5573c0cc60
Show how to run tests, lint, mypy, and the full suite using uv run poe. Change-Id: I5ad232ab2d06b9a1cd780b399bc12fedfcfd6400
- Tornado: replace deprecated @gen.coroutine/yield with async/await - asyncio: drop the loop parameter (deprecated since Python 3.8) Change-Id: I75346d4af5507a2948d20cee92d1d8f05f476b6e
Read the package version from installed metadata so the docs show the current version number. Change-Id: I4769567dc28eab979c5e2f10e266fc887ca779fd
- Add class-level sleep type annotation to TornadoRetrying so the async sleep signature is accepted without ignore_errors - Remove stale type: ignore comments from tornadoweb.py and test_tornado.py - Drop the blanket ignore_errors mypy override for tornadoweb/test_tornado Change-Id: I48134c99c48d7abe6734b34a79255fbcd3f39618
Runs ruff check --fix and ruff format to auto-fix lint issues and format code. Change-Id: I034fac479735c0ee28293747bb2c9227de9b6ca3
curio is unmaintained. Replace the custom sleep example with trio.sleep which is actively maintained and already a dev dependency. Change-Id: I7dd2871693f71f61a6626ef484df82c8f7c4c3d4
Enable import sorting (I), pyupgrade (UP), and flake8-bugbear (B) ruff rules. Ignore B008 (function calls in defaults, intentional API), B905 (zip strict), and E501 (line length, handled by formatter). - Auto-fix import sorting across all files - Convert typing.Union to X | Y syntax (UP007) - Convert typing.Optional to X | None (UP045) - Convert typing.List/Dict to builtin generics (UP006) - Convert .format() to f-strings (UP032) - Rename unused loop vars to _ (B007) - Replace assert False with raise AssertionError (B011) - Remove stale noqa comments (B902, I100) Change-Id: Ic3b97d66f2d8b64eed5db8661566c8605358d9c3
- Pin runner to ubuntu-24.04 for reproducibility (matches CI) - Drop contents:write permission (only id-token:write needed for PyPI trusted publishing) Change-Id: I62d46b341d351e3576d3a1e37bc203949c368c1d
On Python 3.11+, Self is available in the standard typing module. Only fall back to typing_extensions for Python 3.10 (under TYPE_CHECKING only, so no runtime dependency added). Change-Id: I3e39dfbf6ab99b6005026315ff7f070b0910a9dc Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Tornado 4.x and 5.x are long EOL. Tornado 6.0 was released in March 2019 and is the minimum version that supports Python 3.10+ (our minimum). This aligns the declared floor with reality since older versions cannot install on supported Python versions anyway. Change-Id: I821043167849e8df30ef6f7d37409dfc707a7cd3 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Remove the sys.path hack (unnecessary — tenacity is installed as a package when running via uv). Remove doctest_path (sphinx.ext.doctest finds tenacity through the installed package). Remove commented-out sphinx options that were never configured. Remove unused os/sys imports. Change-Id: I9ab61b9422939b1b396fdc4ad66f25f834e74315 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The __all__ list already declares public exports, making the F401 noqa comments on re-export imports unnecessary. Also remove bare noqa on iter/begin_iter (was suppressing UP007) and fix the Union type annotation to use X | Y syntax. Change-Id: I7327e94a653fb97a3497fcddf0566b542746744a Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Enable C4, FURB, PERF, PIE, RET, RUF, SIM, TCH rule sets. Key changes: - Remove all stale noqa comments across the codebase (RUF100) - Sort __all__ alphabetically (RUF022) - Remove superfluous else after return/raise (RET505/RET506) - Replace try/except/pass with contextlib.suppress (SIM105) - Move type-only imports into TYPE_CHECKING blocks (TC001/TC003) - Quote type expressions in typing.cast() calls (TC006) - Use list comprehension instead of loop-append (PERF401) - Fix Cyrillic character in docstring (RUF002) - Remove unnecessary int() wrapping round() (RUF046) - Replace dict() call with literal (C408) Ignored rules: - RUF003: ambiguous unicode in comments (copyright holder names) - RUF005: iterable unpacking vs concatenation (less readable) - RUF012: mutable class defaults (false positive on test fixtures) - SIM108: ternary expressions (less readable in context) Change-Id: I88ea78e2254b8a9fee00743464e44e6d33400f47 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Remove blanket mypy disable comments from test_tenacity.py, test_asyncio.py, test_tornado.py, and test_after.py. Add type annotations to all test methods, helper functions, and inner functions so they pass mypy strict without suppressions. Targeted type: ignore comments are used only for intentional type mismatches in tests (e.g. passing None where BaseRetrying is expected) and dynamically-added attributes on decorated functions (.statistics, .retry, .retry_with). Change-Id: I872c723b28364cf30c546c767ad665336ef62df4 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Remove the positional-only marker (/) from LoggerProtocol.log(). logging.Logger.log() defines msg as a regular parameter, so the positional-only constraint caused mypy to reject logging.Logger as incompatible with the protocol. Closes #554 Change-Id: Icc8ffaff0d828c5103c13e97dd2ca7701089713f Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This field was declared and reset but never read or written anywhere in the codebase. The actual delay tracking uses statistics["delay_since_first_attempt"] instead. Change-Id: If82d3ab8694516b21cae6d33147694e19b7cdc45 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
reraise() is typed as NoReturn and always raises internally. The outer `raise` keyword was dead code that could never execute, and was misleading since it suggested reraise() returns an exception rather than raising one directly. Change-Id: I8ef31ce3d62db7d56adb0053855a1131b54f1fa5 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
typing.Pattern has been deprecated since Python 3.9 in favor of re.Pattern. Since we require Python >=3.10, use the standard form. Change-Id: Ic4a74dff54b2877ff64112220c6805f17c1ffefc Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- "there existence" → "their existence" - "there own view" → "their own view" - "some what" → "somewhat" - "to wraps for" → "to wrap for" Change-Id: Ie9509ff1d7de851708793c9023f3fd728681a868 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
`RetryCallState.seconds_since_start` returns None when `outcome_timestamp` is not set. The `%` format operator in `after_log` would crash with a TypeError in this case. Fall back to "?" when the value is None. Change-Id: Ib18f8aced63c084204b2d4719579fae4b8e557f5 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Y