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

Add support for spec compatible paths in generated server code #257

Merged
merged 2 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clientcompat/internal/clientcompat/clientcompat.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions clientcompat/pycompat/clientcompat_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clientcompat/pycompat/pycompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def main():
client = clientcompat_pb2_twirp.CompatServiceClient(req.service_address)
try:
resp = do_request(client, req)
sys.stdout.write(resp.SerializeToString())
sys.stdout.write(resp.SerializeToString().decode(encoding="utf-8"))
except clientcompat_pb2_twirp.TwirpException as e:
sys.stderr.write(e.code)


def read_request():
input_str = sys.stdin.read()
return clientcompat_pb2.ClientCompatMessage.FromString(input_str)
return clientcompat_pb2.ClientCompatMessage.FromString(input_str.encode(encoding="utf-8"))


def do_request(client, req):
Expand Down
4 changes: 2 additions & 2 deletions example/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions example/service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions install_proto.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ PROTOC_EXISTS=$?
if [ $PROTOC_EXISTS -eq 0 ]; then
echo "Protoc already installed"
PROTOC_VERSION=`protoc --version`
if [ "$PROTOC_VERSION" == "libprotoc 3.11.0" ]; then
if [ "$PROTOC_VERSION" == "libprotoc 3.13.0" ]; then
exit 0
fi
echo "libprotoc 3.11.0 required, but found: $PROTOC_VERSION"
echo "libprotoc 3.13.0 required, but found: $PROTOC_VERSION"
exit 1
fi

Expand All @@ -30,8 +30,8 @@ if [ "$(uname)" == "Darwin" ]; then
elif [ `whoami` == "root" ]; then
mkdir -p /usr/local/src/protoc
pushd /usr/local/src/protoc
wget https://github.com/google/protobuf/releases/download/v3.11.0/protoc-3.11.0-linux-x86_64.zip -O /usr/local/src/protoc-3.11.0-linux-x86_64.zip
unzip -x ../protoc-3.11.0-linux-x86_64.zip
wget https://github.com/google/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip -O /usr/local/src/protoc-3.13.0-linux-x86_64.zip
unzip -x ../protoc-3.13.0-linux-x86_64.zip
if [ ! -e /usr/local/bin/protoc ]; then
ln -s `pwd`/bin/protoc /usr/local/bin/protoc
fi
Expand All @@ -41,8 +41,8 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo chmod a+w /usr/local/src
mkdir -p /usr/local/src/protoc
pushd /usr/local/src/protoc
wget https://github.com/google/protobuf/releases/download/v3.11.0/protoc-3.11.0-linux-x86_64.zip -O /usr/local/src/protoc-3.11.0-linux-x86_64.zip
unzip -x ../protoc-3.11.0-linux-x86_64.zip
wget https://github.com/google/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip -O /usr/local/src/protoc-3.13.0-linux-x86_64.zip
unzip -x ../protoc-3.13.0-linux-x86_64.zip
if [ ! -e /usr/local/bin/protoc ]; then
sudo ln -s `pwd`/bin/protoc /usr/local/bin/protoc
fi
Expand Down
4 changes: 3 additions & 1 deletion internal/twirptest/empty_service/empty_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/gogo_compat/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/google_protobuf_imports/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading