Skip to content

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

Open
@gcbirzan-plutoflume

Description

@gcbirzan-plutoflume

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:

import redis

If redis is importable, the code then goes on to import redis.asyncio, which for older versions doesn't exist:

import redis.asyncio as redis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions