From 32c1158083235a79f2310fd157da3feb84beb5d9 Mon Sep 17 00:00:00 2001 From: MartB Date: Fri, 10 Jun 2022 10:40:36 +0200 Subject: [PATCH] Migrate from aioredis to redis-py See https://github.com/aio-libs/aioredis-py/issues/1301 for reference Signed-off-by: MartB --- README.md | 2 +- postfix_mta_sts_resolver/redis_cache.py | 5 +---- setup.py | 2 +- snapcraft.yaml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1bfb15a..b5d04d4 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ You can say thanks to the author by donations to these wallets: * aiodns * aiohttp * aiosqlite -* aioredis +* redis-py * PyYAML * (optional) uvloop diff --git a/postfix_mta_sts_resolver/redis_cache.py b/postfix_mta_sts_resolver/redis_cache.py index 2a838a9..4ec2c35 100644 --- a/postfix_mta_sts_resolver/redis_cache.py +++ b/postfix_mta_sts_resolver/redis_cache.py @@ -1,13 +1,10 @@ import json import uuid -import aioredis +from redis import asyncio as aioredis from . import defaults from .base_cache import BaseCache, CacheEntry -# Remove once fixed: https://github.com/aio-libs/aioredis-py/issues/1115 -aioredis.Redis.__del__ = lambda *args: None # type: ignore - def pack_entry(entry): ts, pol_id, pol_body = entry # pylint: disable=invalid-name,unused-variable obj = (pol_id, pol_body) diff --git a/setup.py b/setup.py index a692f5e..824619b 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ ], extras_require={ 'sqlite': 'aiosqlite>=0.10.0', - 'redis': 'aioredis>=2.0.0', + 'redis': 'redis>=4.2.0rc1', 'dev': [ 'pytest>=3.0.0', 'pytest-cov', diff --git a/snapcraft.yaml b/snapcraft.yaml index 7fa1407..f7c29ff 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -13,7 +13,7 @@ parts: python-version: python3 python-packages: - "aiosqlite>=0.10.0" - - "aioredis>=2.0.0" + - "redis>=4.2.0rc1" build-packages: - gcc - make