aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/python/sphinx/conf.py
blob: 1eb3a5de7fdda42a2528fdbbc01134346e9dda46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright 2018 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -- Path setup --------------------------------------------------------------

import os
import sys
PYTHON_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                             '..', '..', '..', 'src', 'python')
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio'))
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_health_checking'))
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_reflection'))
sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_testing'))

# -- Project information -----------------------------------------------------

project = 'gRPC Python'
copyright = '2018, The gRPC Authors'
author = 'The gRPC Authors'

# Import generated grpc_version after the path been modified
import grpc_version
version = ".".join(grpc_version.VERSION.split(".")[:3])
release = grpc_version.VERSION

# -- General configuration ---------------------------------------------------

templates_path = ['_templates']
source_suffix = ['.rst', '.md']
master_doc = 'index'
language = 'en'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = None

# --- Extensions Configuration -----------------------------------------------

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.viewcode',
    'sphinx.ext.todo',
    'sphinx.ext.napoleon',
    'sphinx.ext.coverage',
]

napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_special_with_doc = True

autodoc_default_options = {
    'members': None,
}

autodoc_mock_imports = [
    'grpc._cython',
    'grpc_health.v1.health_pb2',
    'grpc_health.v1.health_pb2_grpc',
    'grpc_reflection.v1alpha.reflection_pb2',
    'grpc_reflection.v1alpha.reflection_pb2_grpc',
]

# -- HTML Configuration -------------------------------------------------

html_theme = 'alabaster'
html_theme_options = {
    'fixed_sidebar': True,
    'page_width': '1140px',
    'show_related': True,
    'analytics_id': 'UA-60127042-1',
    'description': grpc_version.VERSION,
    'show_powered_by': False,
}

# -- Options for manual page output ------------------------------------------

man_pages = [(master_doc, 'grpcio', 'grpcio Documentation', [author], 1)]

# -- Options for Texinfo output ----------------------------------------------

texinfo_documents = [
    (master_doc, 'grpcio', 'grpcio Documentation', author, 'grpcio',
     'One line description of project.', 'Miscellaneous'),
]

# -- Options for Epub output -------------------------------------------------

epub_title = project
epub_exclude_files = ['search.html']

# -- Options for todo extension ----------------------------------------------

todo_include_todos = True