Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing redis modules and classes #7676

Merged
merged 16 commits into from
May 4, 2022
Merged

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Apr 22, 2022

This adds asyncio support

Closes #7597

@srittau
Copy link
Collaborator Author

srittau commented Apr 22, 2022

Most types were taken from the partly-annotated upstream code base. I didn't double check them, just cleaned them up.

@srittau
Copy link
Collaborator Author

srittau commented Apr 23, 2022

I tried to track down the pytype errors, but without success. Cc @rchen152

@rchen152
Copy link
Collaborator

I tried to track down the pytype errors, but without success. Cc @rchen152

I'll look into it today.

@rchen152
Copy link
Collaborator

I've got a fix for the pytype issue out for review. Hopefully I'll be able to do a release tomorrow.

rchen152 added a commit to google/pytype that referenced this pull request Apr 26, 2022
Fixes pytype test failures seen in python/typeshed#7676
by doing more extensive re-resolving of external types upon encountering
circular imports. This also lets us remove a previous hack that we put in to
partially work around this problem.

PiperOrigin-RevId: 444427690
rchen152 added a commit to google/pytype that referenced this pull request Apr 26, 2022
Fixes pytype test failures seen in python/typeshed#7676
by doing more extensive re-resolving of external types upon encountering
circular imports. This also lets us remove a previous hack that we put in to
partially work around this problem.

PiperOrigin-RevId: 444427690
@rchen152
Copy link
Collaborator

Just pushed out pytype-2022.4.26, which should fix this issue.

JelleZijlstra added a commit to JelleZijlstra/redis-py that referenced this pull request Apr 30, 2022
NoReturn should be used only when the function never returns. In this case, the awaitable returns None if releasing the lock succeeds, so `Awaitable[None]` is right.

Noticed this while reviewing python/typeshed#7676
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting all this together! I didn't look at everything closely but noticed one issue.

stubs/redis/redis/asyncio/lock.pyi Outdated Show resolved Hide resolved
stubs/redis/redis/asyncio/lock.pyi Outdated Show resolved Hide resolved
Co-authored-by: Jelle Zijlstra <[email protected]>
chayim pushed a commit to redis/redis-py that referenced this pull request May 2, 2022
NoReturn should be used only when the function never returns. In this case, the awaitable returns None if releasing the lock succeeds, so `Awaitable[None]` is right.

Noticed this while reviewing python/typeshed#7676
@srittau srittau merged commit 460537c into python:master May 4, 2022
@srittau srittau deleted the redis-asyncio branch May 4, 2022 09:29
@KMilhan
Copy link

KMilhan commented Aug 30, 2022

@srittau,
Looks like this change doesn't fix the error when you import RedisCluster from asyncio

from redis.asyncio import RedisCluster as AsyncRedisCluster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Redis stubs to 4.2.x
5 participants