[Python] [Pyright] Part 1 - Pyright for src/python/grpcio/grpc/aio/_base_server.py#42240
Closed
asheshvidyut wants to merge 9 commits into
Closed
[Python] [Pyright] Part 1 - Pyright for src/python/grpcio/grpc/aio/_base_server.py#42240asheshvidyut wants to merge 9 commits into
asheshvidyut wants to merge 9 commits into
Conversation
sreenithi
approved these changes
Apr 27, 2026
sreenithi
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just had one comment.
Comment on lines
+91
to
+93
| [[tool.pyright.executionEnvironments]] | ||
| root = "src/python/grpcio_tests" | ||
| extraPaths = ["src/python/grpcio"] No newline at end of file |
Contributor
There was a problem hiding this comment.
I suppose this doesn't have any meaning in this PR because we are not checking any file in src/python/grpcio_tests.
You can keep it here if you need it as a pre-requisite for future PRs or remove it here and add it in later PRs when you enable pyright in files in grpcio_tests. I'm fine either way
Member
Author
There was a problem hiding this comment.
Will prefer to keep it. Thanks.
sergiitk
approved these changes
Apr 28, 2026
| source $VIRTUALENV/bin/activate | ||
| python3 --version | ||
|
|
||
| pip install pyright |
Member
There was a problem hiding this comment.
let's lock it to the latest now
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
sreenithi
approved these changes
Apr 28, 2026
This was referenced May 1, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Jun 9, 2026
…all.py (#42272) # Description This is Part 2 of adding Pyright to AIO stack adds `Pyright` to `src/python/grpcio/grpc/aio/_call.py` # Errors ``` + [03:02:03 UTC] exec pyright _call.py:34:26 - error: "cygrpc" is unknown import symbol (reportAttributeAccessIssue) _call.py:133:16 - error: Type "Metadata | None" is not assignable to return type "Metadata" _call.py:141:16 - error: Type "Metadata | None" is not assignable to return type "Metadata" _call.py:149:16 - error: Type "str | None" is not assignable to return type "str" _call.py:338:35 - error: Type variable "ResponseType" has no meaning in this context (reportGeneralTypeIssues) _call.py:343:31 - error: Cannot assign to attribute "_message_aiter" for class "_StreamResponseMixin*" _call.py:362:19 - error: Return type of async generator function must be compatible with "AsyncGenerator[Unknown, Any]" _call.py:371:35 - error: Cannot assign to attribute "_message_aiter" for class "_StreamResponseMixin*" _call.py:372:16 - error: Type "AsyncIterator[ResponseType]" is not assignable to return type "AsyncIterator[ResponseType@__aiter__]" _call.py:390:35 - error: Variable not allowed in type expression (reportInvalidTypeForm) _call.py:447:38 - error: "Iterable[Any]" is not iterable _call.py:460:32 - error: "AsyncIterable[Any]" is not iterable _call.py:545:15 - error: Type variable "RequestType" has no meaning in this context (reportGeneralTypeIssues) _call.py:608:15 - error: Type variable "RequestType" has no meaning in this context (reportGeneralTypeIssues) _call.py:639:44 - error: Function with declared return type "ResponseType@_send_unary_request" must return value on all code paths 15 errors, 11 warnings, 0 informations ``` # Testing CI # Previous * #42240 # Next * #42273 Closes #42272 COPYBARA_INTEGRATE_REVIEW=#42272 from asheshvidyut:feature/python/pyright-part-2 83c6502 PiperOrigin-RevId: 929268985
asheshvidyut
added a commit
to a-detiste/grpc
that referenced
this pull request
Jun 10, 2026
…ase_server.py (grpc#42240) # Description This is Part 1 of adding Pyright to AIO stack adds `Pyright` to `src/python/grpcio/grpc/aio/_base_server.py ` # Testing CI # Previous * grpc#40353 # Next * grpc#42272 Closes grpc#42240 COPYBARA_INTEGRATE_REVIEW=grpc#42240 from asheshvidyut:feature/python/pyright-part-1 b4680a9 PiperOrigin-RevId: 909803418
asheshvidyut
added a commit
to a-detiste/grpc
that referenced
this pull request
Jun 10, 2026
…all.py (grpc#42272) # Description This is Part 2 of adding Pyright to AIO stack adds `Pyright` to `src/python/grpcio/grpc/aio/_call.py` # Errors ``` + [03:02:03 UTC] exec pyright _call.py:34:26 - error: "cygrpc" is unknown import symbol (reportAttributeAccessIssue) _call.py:133:16 - error: Type "Metadata | None" is not assignable to return type "Metadata" _call.py:141:16 - error: Type "Metadata | None" is not assignable to return type "Metadata" _call.py:149:16 - error: Type "str | None" is not assignable to return type "str" _call.py:338:35 - error: Type variable "ResponseType" has no meaning in this context (reportGeneralTypeIssues) _call.py:343:31 - error: Cannot assign to attribute "_message_aiter" for class "_StreamResponseMixin*" _call.py:362:19 - error: Return type of async generator function must be compatible with "AsyncGenerator[Unknown, Any]" _call.py:371:35 - error: Cannot assign to attribute "_message_aiter" for class "_StreamResponseMixin*" _call.py:372:16 - error: Type "AsyncIterator[ResponseType]" is not assignable to return type "AsyncIterator[ResponseType@__aiter__]" _call.py:390:35 - error: Variable not allowed in type expression (reportInvalidTypeForm) _call.py:447:38 - error: "Iterable[Any]" is not iterable _call.py:460:32 - error: "AsyncIterable[Any]" is not iterable _call.py:545:15 - error: Type variable "RequestType" has no meaning in this context (reportGeneralTypeIssues) _call.py:608:15 - error: Type variable "RequestType" has no meaning in this context (reportGeneralTypeIssues) _call.py:639:44 - error: Function with declared return type "ResponseType@_send_unary_request" must return value on all code paths 15 errors, 11 warnings, 0 informations ``` # Testing CI # Previous * grpc#42240 # Next * grpc#42273 Closes grpc#42272 COPYBARA_INTEGRATE_REVIEW=grpc#42272 from asheshvidyut:feature/python/pyright-part-2 83c6502 PiperOrigin-RevId: 929268985
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is Part 1 of adding Pyright to AIO stack adds
Pyrighttosrc/python/grpcio/grpc/aio/_base_server.pyTesting
CI
Previous
Next