blob: 33f9f3ef8ca0fed400c3fbcb6cacc878d838733d [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 \
26 proto/chromiumos/test/api/test_service.proto
27
28deactivate