_generate_python_doc.sh 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. set -ex
  18. # Some Python package installation requires permission to change homedir. But
  19. # due to the user-override in all_lang_docgen.sh, the user in the container
  20. # doesn't have a home dir which leads to permission denied error.
  21. HOME="$(mktemp -d)"
  22. export HOME
  23. pip install -r requirements.bazel.txt
  24. tools/run_tests/run_tests.py -c opt -l python --compiler python3.8 --newline_on_success -j 8 --build_only
  25. # shellcheck disable=SC1091
  26. source py38/bin/activate
  27. pip install --upgrade Sphinx
  28. python setup.py doc