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

Adds redis/commands.pyi #6180

Closed
wants to merge 2 commits into from
Closed

Adds redis/commands.pyi #6180

wants to merge 2 commits into from

Conversation

sobolevn
Copy link
Member

Generated using stubgen from master version of https://github.com/redis/redis-py

@sobolevn
Copy link
Member Author

It basically copies all the commands from https://github.com/python/typeshed/blob/master/stubs/redis/redis/client.pyi#L378-L750 to a separate mixin class: redis/redis-py@8ea26c4

@sobolevn
Copy link
Member Author

What should we do for this case?


/tmp/tmp8if1xe_2/bin/pip install redis==3.5.* mypy==0.910
MYPYPATH=/home/runner/work/typeshed/typeshed/stubs/redis /tmp/tmp8if1xe_2/bin/python -m mypy.stubtest --ignore-missing-stub --custom-typeshed-dir /home/runner/work/typeshed/typeshed redis --allowlist /home/runner/work/typeshed/typeshed/stubs/redis/@tests/stubtest_allowlist.txt
error: redis.commands failed to import: No module named 'redis.commands'
Stub: at line 1
MypyFile:1(
  /home/runner/work/typeshed/typeshed/stubs/redis/redis/commands.pyi)
Runtime:
MISSING

stubtest failed for redis

@Akuli
Copy link
Collaborator

Akuli commented Oct 15, 2021

How is redis.commands supposed to work?

(e) akuli@akuli-desktop:/tmp$ pip install redis
Collecting redis
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/a7/7c/24fb0511df653cf1a5d938d8f5d19802a88cef255706fdda242ff97e91b7/redis-3.5.3-py2.py3-none-any.whl
Installing collected packages: redis
Successfully installed redis-3.5.3
(e) akuli@akuli-desktop:/tmp$ py
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis.commands
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'redis.commands'

@sobolevn
Copy link
Member Author

@Akuli commands.py is not released yet. See #6180 (comment)

@hauntsaninja
Copy link
Collaborator

I think the options are: 1) hold off on merging this PR until the change is released, 2) add to the stubtest allowlist for redis

@sobolevn
Copy link
Member Author

hold off on merging this PR until the change is released

I'm fine with that! 👍

@hauntsaninja hauntsaninja added the status: deferred Issue or PR deferred until some precondition is fixed label Oct 16, 2021
@sobolevn
Copy link
Member Author

Related #6368
CC @srittau

@srittau
Copy link
Collaborator

srittau commented Nov 25, 2021

I'm sorry, I missed this PR. #6368 is not complete but moved some existing definitions over from redis/client.pyi.

@JelleZijlstra
Copy link
Member

Seems like #6368 superseded this, thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: deferred Issue or PR deferred until some precondition is fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants