mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
ci: fix
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
from importlib.metadata import version
|
||||
from typing import ClassVar, Optional, Type
|
||||
|
||||
# Because this project supports python 3.7 and up, Pyright treats importlib as
|
||||
# an external library and so needs to be told to ignore the type issues it sees.
|
||||
try:
|
||||
# Python 3.8+
|
||||
from importlib.metadata import version # type: ignore
|
||||
except ImportError:
|
||||
# Python 3.7
|
||||
from importlib_metadata import version # type: ignore
|
||||
|
||||
from fastapi_cache.coder import Coder, JsonCoder
|
||||
from fastapi_cache.key_builder import default_key_builder
|
||||
from fastapi_cache.types import Backend, KeyBuilder
|
||||
|
||||
@@ -29,8 +29,8 @@ _T = TypeVar("_T", bound=type)
|
||||
|
||||
CONVERTERS: Dict[str, Callable[[str], Any]] = {
|
||||
# Pendulum 3.0.0 adds parse to __all__, at which point these ignores can be removed
|
||||
"date": lambda x: pendulum.parse(x, exact=True), # type: ignore[attr-defined]
|
||||
"datetime": lambda x: pendulum.parse(x, exact=True), # type: ignore[attr-defined]
|
||||
"date": lambda x: pendulum.parse(x, exact=True),
|
||||
"datetime": lambda x: pendulum.parse(x, exact=True),
|
||||
"decimal": Decimal,
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ def cache(
|
||||
) -> Callable[[Callable[P, Awaitable[R]]], Callable[P, Awaitable[Union[R, Response]]]]:
|
||||
"""
|
||||
cache all function
|
||||
:param injected_dependency_namespace:
|
||||
:param namespace:
|
||||
:param expire:
|
||||
:param coder:
|
||||
|
||||
Reference in New Issue
Block a user