C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | # |
| 3 | # Copyright 2021 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | # |
| 7 | # Generates python proto bindings that include the grpc bindings. |
| 8 | |
| 9 | readonly script_dir="$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")" |
| 10 | |
| 11 | cd "${script_dir}" |
| 12 | |
| 13 | readonly venv_path=.venv |
| 14 | /usr/bin/python3 -m venv "${venv_path}" |
| 15 | source "${venv_path}/bin/activate" |
| 16 | |
| 17 | echo "Installing grpcio-tools" |
| 18 | # TODO(crbug.com/1207957) Remove once this is included in vpython by default |
| 19 | pip install -q grpcio-tools==1.32.0 |
| 20 | |
| 21 | echo "Generating proto and grpc bindings" |
| 22 | python3 -m grpc_tools.protoc \ |
| 23 | -Iproto \ |
| 24 | --python_out=python \ |
| 25 | --grpc_python_out=python \ |
C Shapiro | 7a8e7f1 | 2021-05-18 15:44:58 -0500 | [diff] [blame] | 26 | proto/chromiumos/test/api/execution_service.proto \ |
| 27 | proto/chromiumos/test/api/provision_service.proto |
C Shapiro | 367efde | 2021-05-11 06:56:33 -0500 | [diff] [blame] | 28 | |
| 29 | deactivate |