xref: /aosp_15_r20/external/grpc-grpc/tools/distrib/docgen/_generate_python_doc.sh (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1#! /bin/bash
2# Copyright 2020 The gRPC Authors
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# This script is meant to be ran in Docker instance of python:3.8.
17
18set -ex
19
20# Some Python package installation requires permission to change homedir. But
21# due to the user-override in all_lang_docgen.sh, the user in the container
22# doesn't have a home dir which leads to permission denied error.
23HOME="$(mktemp -d)"
24export HOME
25
26pip install -r requirements.bazel.txt
27tools/run_tests/run_tests.py -c opt -l python --compiler python3.8 --newline_on_success -j 8 --build_only
28# shellcheck disable=SC1091
29source py38/bin/activate
30pip install --upgrade Sphinx
31python setup.py doc
32