Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ jobs:
tox: py311
- python: "3.12"
tox: py312
- python: "3.12"
tox: pep8
- python: "3.13"
tox: py313,py313-trio
- python: "3.11"
tox: py313
- python: "3.14"
tox: py314,py314-trio
- python: "3.14"
tox: pep8
- python: "3.14"
tox: mypy
steps:
- name: Checkout 🛎️
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v5.6.0
with:
python-version: 3.13
python-version: 3.14

- name: Install build
run: |
Expand Down
5 changes: 3 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ queue_rules:
- "check-success=test (3.10, py310)"
- "check-success=test (3.11, py311)"
- "check-success=test (3.12, py312)"
- "check-success=test (3.13, py313,py313-trio)"
- "check-success=test (3.12, pep8)"
- "check-success=test (3.13, py313)"
- "check-success=test (3.14, py314,py314-trio)"
- "check-success=test (3.14, pep8)"

pull_request_rules:
- name: warn on no changelog
Expand Down
3 changes: 3 additions & 0 deletions releasenotes/notes/support-py3.14-14928188cab53b99.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
features:
- Python 3.14 support has been added.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifier =
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Topic :: Utilities

[options]
Expand Down
12 changes: 4 additions & 8 deletions tenacity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,15 @@ def statistics(self) -> t.Dict[str, t.Any]:
future we may provide a way to aggregate the various
statistics from each thread).
"""
try:
return self._local.statistics # type: ignore[no-any-return]
except AttributeError:
if not hasattr(self._local, "statistics"):
self._local.statistics = t.cast(t.Dict[str, t.Any], {})
return self._local.statistics
return self._local.statistics # type: ignore[no-any-return]

@property
def iter_state(self) -> IterState:
try:
return self._local.iter_state # type: ignore[no-any-return]
except AttributeError:
if not hasattr(self._local, "iter_state"):
self._local.iter_state = IterState()
return self._local.iter_state
return self._local.iter_state # type: ignore[no-any-return]

def wraps(self, f: WrappedFn) -> WrappedFn:
"""Wrap a function for retrying.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
def asynctest(callable_):
@wraps(callable_)
def wrapper(*a, **kw):
loop = asyncio.get_event_loop()
return loop.run_until_complete(callable_(*a, **kw))
return asyncio.run(callable_(*a, **kw))

return wrapper

Expand Down
3 changes: 1 addition & 2 deletions tests/test_issue_478.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ def asynctest(
) -> typing.Callable[..., typing.Any]:
@wraps(callable_)
def wrapper(*a: typing.Any, **kw: typing.Any) -> typing.Any:
loop = asyncio.get_event_loop()
return loop.run_until_complete(callable_(*a, **kw))
return asyncio.run(callable_(*a, **kw))

return wrapper

Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
# we only test trio on latest python version
envlist = py3{9,10,11,12,13,13-trio}, pep8, pypy3
envlist = py3{9,10,11,12,13,14,14-trio}, pep8, pypy3
skip_missing_interpreters = True

[testenv]
Expand All @@ -11,9 +11,9 @@ deps =
.[doc]
trio: trio
commands =
py3{8,9,10,11,12,13},pypy3: pytest {posargs}
py3{8,9,10,11,12,13},pypy3: sphinx-build -a -E -W -b doctest doc/source doc/build
py3{8,9,10,11,12,13},pypy3: sphinx-build -a -E -W -b html doc/source doc/build
py3{8,9,10,11,12,13,14},pypy3: pytest {posargs}
py3{8,9,10,11,12,13,14},pypy3: sphinx-build -a -E -W -b doctest doc/source doc/build
py3{8,9,10,11,12,13,14},pypy3: sphinx-build -a -E -W -b html doc/source doc/build

[testenv:pep8]
basepython = python3
Expand Down