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
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
strategy:
matrix:
include:
- python: "3.9"
tox: py39
- python: "3.10"
tox: py310
- python: "3.11"
Expand Down
1 change: 0 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ queue_rules:
- author = jd
- "#approved-reviews-by >= 1"
- author = dependabot[bot]
- "check-success=test (3.9, py39)"
- "check-success=test (3.10, py310)"
- "check-success=test (3.11, py311)"
- "check-success=test (3.12, py312)"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend="setuptools.build_meta"
[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py39"
target-version = "py310"

[tool.mypy]
strict = true
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/drop-python-3.9-ecfa2d7db9773e96.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
upgrade:
- |
Python 3.9 has reached end-of-life and is no longer supported.
The minimum supported version is now Python 3.10.
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ classifier =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Expand All @@ -23,7 +22,7 @@ classifier =

[options]
install_requires =
python_requires = >=3.9
python_requires = >=3.10
packages = find:

[options.packages.find]
Expand Down
15 changes: 2 additions & 13 deletions tenacity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,7 @@
WrappedFn = t.TypeVar("WrappedFn", bound=t.Callable[..., t.Any])


dataclass_kwargs = {}
if sys.version_info >= (3, 10):
dataclass_kwargs.update({"slots": True})


@dataclasses.dataclass(**dataclass_kwargs)
@dataclasses.dataclass(slots=True)
class IterState:
actions: t.List[t.Callable[["RetryCallState"], t.Any]] = dataclasses.field(
default_factory=list
Expand Down Expand Up @@ -486,13 +481,7 @@ def __call__(
return do # type: ignore[no-any-return]


if sys.version_info >= (3, 9):
FutureGenericT = futures.Future[t.Any]
else:
FutureGenericT = futures.Future


class Future(FutureGenericT):
class Future(futures.Future[t.Any]):
"""Encapsulates a (future or past) attempted call to a target function."""

def __init__(self, attempt_number: int) -> None:
Expand Down
11 changes: 1 addition & 10 deletions tests/test_tenacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import datetime
import logging
import re
import sys
import time
import typing
import unittest
Expand All @@ -28,6 +27,7 @@
from unittest import mock

import pytest
from typeguard import check_type

import tenacity
from tenacity import RetryCallState, RetryError, Retrying, retry
Expand Down Expand Up @@ -1729,17 +1729,8 @@ def test_retry_error_is_pickleable(self):


class TestRetryTyping(unittest.TestCase):
@pytest.mark.skipif(
sys.version_info < (3, 0), reason="typeguard not supported for python 2"
)
def test_retry_type_annotations(self):
"""The decorator should maintain types of decorated functions."""
# Just in case this is run with unit-test, return early for py2
if sys.version_info < (3, 0):
return

# Function-level import because we can't install this for python 2.
from typeguard import check_type

def num_to_str(number):
# type: (int) -> str
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,14,14-trio}, pep8, pypy3
envlist = py3{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,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
py3{10,11,12,13,14},pypy3: pytest {posargs}
py3{10,11,12,13,14},pypy3: sphinx-build -a -E -W -b doctest doc/source doc/build
py3{10,11,12,13,14},pypy3: sphinx-build -a -E -W -b html doc/source doc/build

[testenv:pep8]
basepython = python3
Expand Down