blob: 5e9d7531565b9ff7bbc9db60478c3139449b3e8d [file] [log] [blame]
C Shapiro367efde2021-05-11 06:56:33 -05001#!/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
9readonly script_dir="$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")"
10
11cd "${script_dir}"
12
13readonly venv_path=.venv
14/usr/bin/python3 -m venv "${venv_path}"
15source "${venv_path}/bin/activate"
16
17echo "Installing grpcio-tools"
18# TODO(crbug.com/1207957) Remove once this is included in vpython by default
19pip install -q grpcio-tools==1.32.0
20
21echo "Generating proto and grpc bindings"
22python3 -m grpc_tools.protoc \
23 -Iproto \
24 --python_out=python \
25 --grpc_python_out=python \
C Shapiro7a8e7f12021-05-18 15:44:58 -050026 proto/chromiumos/test/api/execution_service.proto \
27 proto/chromiumos/test/api/provision_service.proto
C Shapiro367efde2021-05-11 06:56:33 -050028
29deactivate