Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop python<=3.7 support #219

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion backoff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
"""
Function decoration for backoff and retry

Expand Down
1 change: 0 additions & 1 deletion backoff/_async.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import datetime
import functools
import asyncio
Expand Down
2 changes: 0 additions & 2 deletions backoff/_common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding:utf-8

import functools
import logging
import sys
Expand Down
1 change: 0 additions & 1 deletion backoff/_decorator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import asyncio
import logging
import operator
Expand Down
2 changes: 0 additions & 2 deletions backoff/_jitter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding:utf-8

import random


Expand Down
1 change: 0 additions & 1 deletion backoff/_sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import datetime
import functools
import time
Expand Down
13 changes: 1 addition & 12 deletions backoff/_typing.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# coding:utf-8
import logging
import sys
from typing import (Any, Callable, Coroutine, Dict, Generator, Sequence, Tuple,
TypeVar, Union)

if sys.version_info >= (3, 8): # pragma: no cover
from typing import TypedDict
else: # pragma: no cover
# use typing_extensions if installed but don't require it
try:
from typing_extensions import TypedDict
except ImportError:
class TypedDict(dict):
def __init_subclass__(cls, **kwargs: Any) -> None:
return super().__init_subclass__()
from typing import TypedDict


class _Details(TypedDict):
Expand Down
11 changes: 7 additions & 4 deletions backoff/_wait_gen.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# coding:utf-8

import itertools
import math
from typing import Any, Callable, Generator, Iterable, Optional, Union
from typing import Any
import sys
if sys.version_info < (3,12):
import itertools


def expo(
Expand Down Expand Up @@ -93,10 +96,10 @@ def constant(
# Advance past initial .send() call
yield # type: ignore[misc]

try:
itr = iter(interval) # type: ignore
except TypeError:
if sys.version_info < (3,12):
itr = itertools.repeat(interval) # type: ignore
else:
itr = iter(interval) # type: ignore

for val in itr:
yield val
Expand Down
1 change: 0 additions & 1 deletion backoff/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
from ._typing import Details

__all__ = [
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ classifiers = ['Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities']
Expand All @@ -27,7 +28,7 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.7"
python = ">=3.8"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
Expand Down
1 change: 0 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import collections
import functools

Expand Down
1 change: 0 additions & 1 deletion tests/test_backoff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import datetime
import itertools
import logging
Expand Down
2 changes: 0 additions & 2 deletions tests/test_backoff_async.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding:utf-8

import asyncio # Python 3.5 code and syntax is allowed in this file
import random

Expand Down
1 change: 0 additions & 1 deletion tests/test_jitter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import backoff


Expand Down
2 changes: 0 additions & 2 deletions tests/test_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding:utf-8

from backoff.types import Details


Expand Down
1 change: 0 additions & 1 deletion tests/test_wait_gen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding:utf-8
import backoff
import math

Expand Down