Skip to content

Commit 1fbf02f

Browse files
committed
chore(deps): remove compatibility layer with python < 3.8 (3.8 officially not supported)
1 parent b633a68 commit 1fbf02f

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

fastapi_jsonrpc/__init__.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
from collections import ChainMap, defaultdict
77
from collections.abc import Coroutine
88
from contextlib import AsyncExitStack, AbstractAsyncContextManager, asynccontextmanager, contextmanager
9+
from functools import cached_property
910
from types import FunctionType
10-
from typing import List, Union, Any, Callable, Type, Optional, Dict, Sequence
11+
from typing import List, Union, Any, Callable, Type, Optional, Dict, Sequence, Literal
1112

1213
import pydantic
1314
from fastapi.dependencies.utils import _should_embed_body_fields # noqa
1415
from fastapi.openapi.constants import REF_PREFIX
1516

16-
try:
17-
from typing import Literal
18-
except ImportError:
19-
from typing_extensions import Literal
2017

2118
from fastapi._compat import ModelField, Undefined # noqa
2219
from fastapi.dependencies.models import Dependant
@@ -38,19 +35,6 @@
3835

3936
logger = logging.getLogger(__name__)
4037

41-
try:
42-
from functools import cached_property
43-
except ImportError:
44-
class cached_property: # noqa
45-
def __init__(self, func):
46-
self.__doc__ = getattr(func, "__doc__")
47-
self.func = func
48-
49-
def __get__(self, obj, cls):
50-
if obj is None:
51-
return self
52-
value = obj.__dict__[self.func.__name__] = self.func(obj)
53-
return value
5438

5539
try:
5640
import sentry_sdk

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ['json-rpc', 'asgi', 'swagger', 'openapi', 'fastapi', 'pydantic', 'st
1111
exclude = ["example1.py", "example2.py"]
1212

1313
[tool.poetry.dependencies]
14-
python = "^3.8"
14+
python = "^3.9"
1515
aiojobs = ">=1.1.0"
1616
fastapi = [
1717
{version = ">=0.112.4"},

0 commit comments

Comments
 (0)