aio-libs / aio-libs/aiocache

Library is unusable with redis older than 4.2.0 installed, even if redis isn't used

Aperta
#693 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.4k
Fork
181
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The Python redis library didn't have async support before 4.2.0, but the check for whether redis is installed doesn't take that into account: https://github.com/aio-libs/aiocache/blob/19e04665dfd1fad00c2d3ab9061a81db9acd368e/aiocache/__init__.py#L14

If `redis` is importable, the code then goes on to import `redis.asyncio`, which for older versions doesn't exist: https://github.com/aio-libs/aiocache/blob/19e04665dfd1fad00c2d3ab9061a81db9acd368e/aiocache/backends/redis.py#L5

While, technically, this isn't something that one should do, we hit this problem because of our complicated dependencies, where an internal library we use in our async code also depends on an older redis, even though that part is not used by our async code.

I think rather than hardcoding a version check, an `import redis.asyncio` in the try/except block.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.