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
L103 Draft: Add Types to the remainder of the gRPC Python API Surface #337
Open
XuanWang-Amos
wants to merge
3
commits into
grpc:master
Choose a base branch
from
XuanWang-Amos:PyTypingGRFC
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,12 @@ Add Typing to gRPC Python Sync API | |
* Approver: gnossen | ||
* Status: Draft | ||
* Implemented in: Python | ||
* Last updated: 11/09/2022 | ||
* Last updated: 11/10/2022 | ||
* Discussion at: <google group thread> (filled after thread exists) | ||
|
||
## Abstract | ||
|
||
Add type annotation to Python Sync API. | ||
Add type annotations to the remainder of the gRPC Python API. | ||
|
||
## Background | ||
|
||
|
@@ -19,26 +19,19 @@ This proposal plans to add type annotation to python Sync public APIs which allo | |
|
||
|
||
### Related Proposals: | ||
* Loosely related: https://github.com/lidizheng/proposal/blob/grpc-python-async-api/L58-python-async-api.md#introduce-typing-to-generated-code | ||
* Loosely related to [Async API proposal](https://github.com/lidizheng/proposal/blob/grpc-python-async-api/L58-python-async-api.md#introduce-typing-to-generated-code). | ||
* The proposal includes the part to introduce typing to gRPC Python Async APIs. | ||
|
||
|
||
## Proposal | ||
|
||
Add type annotation to the following Python APIs: | ||
* All APIs in `__init__.py` (the actuall list is too long, please refer to following PR for changes): | ||
Add type annotation to the following: | ||
* All public Python APIs listed in [`__all__` variable](https://github.com/grpc/grpc/blob/54dd7563c2d563bff74e4b558f2e985db4a01f2d/src/python/grpcio/grpc/__init__.py#L2100) (the actuall list is too long, please refer to the following PR for changes): | ||
* [PR link holder] | ||
* gRPC Python generated Code. | ||
* [PR Link holder] | ||
* Python ancillary packages. | ||
XuanWang-Amos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* [PR link holder] | ||
* `grpc/src/python/grpcio/grpc/_runtime_protos.py` | ||
```python | ||
def protos(protobuf_path): # pylint: disable=unused-argument | ||
... | ||
|
||
def services(protobuf_path): # pylint: disable=unused-argument | ||
... | ||
|
||
def protos_and_services(protobuf_path): # pylint: disable=unused-argument | ||
... | ||
``` | ||
|
||
## Rationale | ||
|
||
|
@@ -70,9 +63,11 @@ def __call__(self, | |
|
||
## Implementation | ||
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. Once it exists, the implementation PR should be linked to here. |
||
|
||
1. Add typing to internal APIs. | ||
2. Add typing to public API and test though pre-release. | ||
3. Add typing to public APIs. | ||
* Add typing to internal APIs. | ||
* [PR1: Add typing for some internal python files.](https://github.com/grpc/grpc/pull/31514) | ||
* Add typing to public API and test though pre-release. | ||
XuanWang-Amos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* [PR link holder] | ||
* Release typed public APIs. | ||
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. |
||
|
||
## Open issues (if applicable) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Reminder to create the Google group thread once the gRFC is in a presentable state.