-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add grpc.experimental.gevent stubs #15839
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from typing_extensions import assert_type | ||
|
|
||
| import grpc.experimental.gevent as grpc_gevent | ||
|
|
||
| assert_type(grpc_gevent.init_gevent(), None) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can just delete this file, since def __getattr__(name: str): ... # incomplete moduleThe |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||
| from . import gevent as gevent | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The runtime doesn't actually re-export $ uv run -w grpcio python3 -c 'import grpc.experimental; grpc.experimental.gevent'
Traceback (most recent call last):
File "<string>", line 1, in <module>
import grpc.experimental; grpc.experimental.gevent
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'grpc.experimental' has no attribute 'gevent'Type checkers understand submodule relationships, so we don't need to add anything here in order for them to understand that the
Suggested change
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| def init_gevent() -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this file - test cases are only needed for weird and/or complicated cases that might regress in the future. This test basically repeats the signature (and a particularly trivial one at that :-)), so it isn't really necessary