You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with gRPC on v2.0.0b3, if the .proto package name starts with a capital letter, e.g.
packageEcho;
Then the generated file becomes significantly different and invalid. Most obviously there is from .. import MessageName as _MessageName__ for the message types and it can't be imported.
For example, take the echo.proto example from the README.md and generate as suggested with python -m grpc_tools.protoc -I . --python_betterproto_out=. echo.proto, it seems fine, but edit it to package Echo; and in Echo/__init__.py you get, among other changes not limited to s/echo/Echo, at the end:
from .. importEchoEchoRequestas_EchoEchoRequest__from .. importEchoEchoResponseas_EchoEchoResponse__from .. importEchoEchoStreamResponseas_EchoEchoStreamResponse__
These don't exist, and the package can't be imported.
Found in v2.0.0b3. Thanks!
For completeness, here's the problematic .proto
syntax="proto3";
packageEcho;
messageEchoRequest {
stringvalue=1;
// Number of extra times to echouint32extra_times=2;
}
messageEchoResponse {
repeatedstringvalues=1;
}
messageEchoStreamResponse {
stringvalue=1;
}
serviceEcho {
rpcEcho(EchoRequest) returns (EchoResponse);
rpcEchoStream(EchoRequest) returns (streamEchoStreamResponse);
}
The text was updated successfully, but these errors were encountered:
Working with gRPC on
v2.0.0b3
, if the.proto
package name starts with a capital letter, e.g.Then the generated file becomes significantly different and invalid. Most obviously there is
from .. import MessageName as _MessageName__
for the message types and it can't be imported.For example, take the
echo.proto
example from the README.md and generate as suggested withpython -m grpc_tools.protoc -I . --python_betterproto_out=. echo.proto
, it seems fine, but edit it topackage Echo;
and inEcho/__init__.py
you get, among other changes not limited tos/echo/Echo
, at the end:These don't exist, and the package can't be imported.
Found in
v2.0.0b3
. Thanks!For completeness, here's the problematic
.proto
The text was updated successfully, but these errors were encountered: