diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d8ae113..ff4a5050 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: types: [text] stages: [commit, push, manual] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.5.1 + rev: v2.7.1 hooks: - id: prettier - repo: https://github.com/rhysd/actionlint diff --git a/README.md b/README.md index 71edb3ba..cbff264f 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ Inspired by ## Main Dependencies -- [Python +3.6](https://www.python.org) -- [aioredis 2.0](https://aioredis.readthedocs.io/en/latest/) +- [Python +3.7](https://www.python.org) +- [redis-py <4.3.0](https://github.com/redis/redis-py) - [pydantic](https://github.com/samuelcolvin/pydantic/) ## Getting Started diff --git a/poetry.lock b/poetry.lock index 33377eab..4e0d5f52 100644 --- a/poetry.lock +++ b/poetry.lock @@ -20,21 +20,6 @@ yarl = ">=1.0,<2.0" [package.extras] speedups = ["aiodns", "brotli", "cchardet"] -[[package]] -name = "aioredis" -version = "2.0.1" -description = "asyncio (PEP 3156) Redis support" -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -async-timeout = "*" -typing-extensions = "*" - -[package.extras] -hiredis = ["hiredis (>=1.0)"] - [[package]] name = "aiosignal" version = "1.2.0" @@ -276,7 +261,7 @@ python-versions = ">=3.6,<4.0" name = "deprecated" version = "1.2.13" description = "Python @deprecated decorator to deprecate old python classes, functions or methods." -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -582,7 +567,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "importlib-metadata" version = "4.2.0" description = "Read metadata from Python packages" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -713,7 +698,7 @@ python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.* name = "packaging" version = "21.3" description = "Core utilities for Python packages" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -900,7 +885,7 @@ testutil = ["gitpython (>3)"] name = "pyparsing" version = "3.0.9" description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "dev" +category = "main" optional = false python-versions = ">=3.6.8" @@ -1077,7 +1062,7 @@ python-versions = ">=3.6" name = "redis" version = "4.3.4" description = "Python client for Redis database and key-value store" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -1534,7 +1519,7 @@ testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", name = "wrapt" version = "1.14.1" description = "Module for decorators, wrappers and monkey patching." -category = "dev" +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" @@ -1579,7 +1564,7 @@ typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} name = "zipp" version = "3.8.1" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" +category = "main" optional = false python-versions = ">=3.7" @@ -1594,7 +1579,7 @@ fastapi-crudrouter = [] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "c2d9175a968bb90d290159ee44bca10472855907c38203f90aa8e9d93f7ebbeb" +content-hash = "602266b1c997c1055845e82c281a014dad857da4020bfa9284a728a7ee31585d" [metadata.files] aiohttp = [ @@ -1671,10 +1656,6 @@ aiohttp = [ {file = "aiohttp-3.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:1c182cb873bc91b411e184dab7a2b664d4fea2743df0e4d57402f7f3fa644bac"}, {file = "aiohttp-3.8.1.tar.gz", hash = "sha256:fc5471e1a54de15ef71c1bc6ebe80d4dc681ea600e68bfd1cbce40427f0b7578"}, ] -aioredis = [ - {file = "aioredis-2.0.1-py3-none-any.whl", hash = "sha256:9ac0d0b3b485d293b8ca1987e6de8658d7dafcca1cddfcd1d506cae8cdebfdd6"}, - {file = "aioredis-2.0.1.tar.gz", hash = "sha256:eaa51aaf993f2d71f54b70527c440437ba65340588afeb786cd87c55c89cd98e"}, -] aiosignal = [ {file = "aiosignal-1.2.0-py3-none-any.whl", hash = "sha256:26e62109036cd181df6e6ad646f91f0dcfd05fe16d0cb924138ff2ab75d64e3a"}, {file = "aiosignal-1.2.0.tar.gz", hash = "sha256:78ed67db6c7b7ced4f98e495e572106d5c432a93e1ddd1bf475e1dc05f5b7df2"}, diff --git a/pydantic_aioredis/abstract.py b/pydantic_aioredis/abstract.py index 7b63672c..f1858d49 100644 --- a/pydantic_aioredis/abstract.py +++ b/pydantic_aioredis/abstract.py @@ -14,7 +14,6 @@ from typing import Union from uuid import UUID -import aioredis from pydantic import BaseModel from pydantic.fields import SHAPE_DEFAULTDICT from pydantic.fields import SHAPE_DICT @@ -26,6 +25,7 @@ from pydantic.fields import SHAPE_TUPLE from pydantic.fields import SHAPE_TUPLE_ELLIPSIS from pydantic_aioredis.config import RedisConfig +from redis import asyncio as aioredis # JSON_DUMP_SHAPES are object types that are serialized to JSON using json.dumps JSON_DUMP_SHAPES = ( diff --git a/pydantic_aioredis/store.py b/pydantic_aioredis/store.py index e3b82226..c558abb2 100644 --- a/pydantic_aioredis/store.py +++ b/pydantic_aioredis/store.py @@ -3,10 +3,10 @@ from typing import Dict from typing import Optional -import aioredis from pydantic_aioredis.abstract import _AbstractStore from pydantic_aioredis.config import RedisConfig from pydantic_aioredis.model import Model +from redis import asyncio as aioredis class Store(_AbstractStore): diff --git a/pyproject.toml b/pyproject.toml index 15305706..552c4314 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ Changelog = "https://github.com/andrewthetechie/pydantic-aioredis/releases" [tool.poetry.dependencies] python = "^3.7" pydantic = "^1.8.2" -aioredis = "^2.0.0" +redis = "^4.3.4" [tool.poetry.extras] FastAPI= ['fastapi>=0.63.0']