| 1 |
# Copyright 2018 The gRPC Authors |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
# -- Path setup -------------------------------------------------------------- |
| 16 |
|
| 17 |
import os |
| 18 |
import sys |
| 19 |
PYTHON_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', |
| 20 |
'..', '..', 'src', 'python') |
| 21 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio')) |
| 22 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_channelz')) |
| 23 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_health_checking')) |
| 24 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_reflection')) |
| 25 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_status')) |
| 26 |
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_testing')) |
| 27 |
|
| 28 |
# -- Project information ----------------------------------------------------- |
| 29 |
|
| 30 |
project = 'gRPC Python' |
| 31 |
copyright = '2020, The gRPC Authors' |
| 32 |
author = 'The gRPC Authors' |
| 33 |
|
| 34 |
# Import generated grpc_version after the path been modified |
| 35 |
import grpc_version |
| 36 |
version = '.'.join(grpc_version.VERSION.split('.')[:3]) |
| 37 |
release = grpc_version.VERSION |
| 38 |
if 'dev' in grpc_version.VERSION: |
| 39 |
branch = 'master' |
| 40 |
else: |
| 41 |
branch = 'v%s.%s.x' % tuple(grpc_version.VERSION.split('.')[:2]) |
| 42 |
|
| 43 |
# -- General configuration --------------------------------------------------- |
| 44 |
|
| 45 |
templates_path = ['_templates'] |
| 46 |
source_suffix = ['.rst', '.md'] |
| 47 |
master_doc = 'index' |
| 48 |
language = 'en' |
| 49 |
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 50 |
pygments_style = None |
| 51 |
|
| 52 |
# --- Extensions Configuration ----------------------------------------------- |
| 53 |
|
| 54 |
extensions = [ |
| 55 |
'sphinx.ext.autodoc', |
| 56 |
'sphinx.ext.viewcode', |
| 57 |
'sphinx.ext.todo', |
| 58 |
'sphinx.ext.napoleon', |
| 59 |
'sphinx.ext.coverage', |
| 60 |
'sphinx.ext.autodoc.typehints', |
| 61 |
] |
| 62 |
|
| 63 |
napoleon_google_docstring = True |
| 64 |
napoleon_numpy_docstring = True |
| 65 |
napoleon_include_special_with_doc = True |
| 66 |
|
| 67 |
autodoc_default_options = { |
| 68 |
'members': None, |
| 69 |
} |
| 70 |
|
| 71 |
autodoc_mock_imports = [] |
| 72 |
|
| 73 |
autodoc_typehints = 'description' |
| 74 |
|
| 75 |
# -- HTML Configuration ------------------------------------------------- |
| 76 |
|
| 77 |
html_theme = 'alabaster' |
| 78 |
html_theme_options = { |
| 79 |
'fixed_sidebar': True, |
| 80 |
'page_width': '1140px', |
| 81 |
'show_related': True, |
| 82 |
'analytics_id': 'UA-60127042-1', |
| 83 |
'description': grpc_version.VERSION, |
| 84 |
'show_powered_by': False, |
| 85 |
} |
| 86 |
html_static_path = ["_static"] |
| 87 |
|
| 88 |
# -- Options for manual page output ------------------------------------------ |
| 89 |
|
| 90 |
man_pages = [(master_doc, 'grpcio', 'grpcio Documentation', [author], 1)] |
| 91 |
|
| 92 |
# -- Options for Texinfo output ---------------------------------------------- |
| 93 |
|
| 94 |
texinfo_documents = [ |
| 95 |
(master_doc, 'grpcio', 'grpcio Documentation', author, 'grpcio', |
| 96 |
'One line description of project.', 'Miscellaneous'), |
| 97 |
] |
| 98 |
|
| 99 |
# -- Options for Epub output ------------------------------------------------- |
| 100 |
|
| 101 |
epub_title = project |
| 102 |
epub_exclude_files = ['search.html'] |
| 103 |
|
| 104 |
# -- Options for todo extension ---------------------------------------------- |
| 105 |
|
| 106 |
todo_include_todos = True |
| 107 |
|
| 108 |
# -- Options for substitutions ----------------------------------------------- |
| 109 |
|
| 110 |
rst_epilog = '.. |grpc_types_link| replace:: https://github.com/grpc/grpc/blob/%s/include/grpc/impl/codegen/grpc_types.h' % branch |