ahopkins/sanic-session

aioredis is now in redis >= 4.2

nc7s opened this issue · 0 comments

nc7s commented

According to https://github.com/aio-libs/aioredis-py (which is now archived due to the merge):

Aioredis is now in redis-py 4.2.0rc1+
To install, just do pip install redis>=4.2.0rc1. The code is almost the exact same. You will just need to import like so:

from redis import asyncio as aioredis

This way you don't have to change all your code, just the imports.

Hopefully we can just remove this block:

if aioredis is None:
raise RuntimeError(
"Please install aioredis: pip install sanic_session[aioredis]"
)

(Personally I don't like naming the module using asyncio_redis as .redis, but that's your call.)