Debian Codegraph @

docs/source/conf.py

raw ◀ ▶
1 Debian patch touch this file
1 # -*- coding: utf-8 -*-
2 #
3 # Mypy documentation build configuration file, created by
4 # sphinx-quickstart on Sun Sep 14 19:50:35 2014.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14
15 from __future__ import annotations
16
17 import os
18 import sys
19
20 from sphinx.application import Sphinx
21 from sphinx.util.docfields import Field
22
23 # If extensions (or modules to document with autodoc) are in another directory,
24 # add these directories to sys.path here. If the directory is relative to the
25 # documentation root, use os.path.abspath to make it absolute, like shown here.
26 sys.path.insert(0, os.path.abspath("../.."))
27
28 from mypy.version import __version__ as mypy_version
29
30 # -- General configuration ------------------------------------------------
31
32 # If your documentation needs a minimal Sphinx version, state it here.
33 # needs_sphinx = '1.0'
34
35 # Add any Sphinx extension module names here, as strings. They can be
36 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37 # ones.
38 extensions = [
39 "sphinx.ext.intersphinx",
40 "sphinx_inline_tabs",
41 "docs.source.html_builder",
42 "myst_parser",
43 ]
44
45 # Add any paths that contain templates here, relative to this directory.
46 templates_path = ["_templates"]
47
48 # The suffix of source filenames.
49 source_suffix = ".rst"
50
51 # The encoding of source files.
52 # source_encoding = 'utf-8-sig'
53
54 # The master toctree document.
55 master_doc = "index"
56
57 # General information about the project.
58 project = "mypy"
59 copyright = "2012-%Y Jukka Lehtosalo and mypy contributors"
60
61 # The version info for the project you're documenting, acts as replacement for
62 # |version| and |release|, also used in various other places throughout the
63 # built documents.
64 #
65 # The short X.Y version.
66 version = mypy_version.split("-")[0]
67 # The full version, including alpha/beta/rc tags.
68 release = mypy_version
69
70 # The language for content autogenerated by Sphinx. Refer to documentation
71 # for a list of supported languages.
72 # language = None
73
74 # There are two options for replacing |today|: either, you set today to some
75 # non-false value, then it is used:
76 # today = ''
77 # Else, today_fmt is used as the format for a strftime call.
78 # today_fmt = '%B %d, %Y'
79
80 # List of patterns, relative to source directory, that match files and
81 # directories to ignore when looking for source files.
82 exclude_patterns = []
83
84 # The reST default role (used for this markup: `text`) to use for all
85 # documents.
86 # default_role = None
87
88 # If true, '()' will be appended to :func: etc. cross-reference text.
89 # add_function_parentheses = True
90
91 # If true, the current module name will be prepended to all description
92 # unit titles (such as .. function::).
93 # add_module_names = True
94
95 # If true, sectionauthor and moduleauthor directives will be shown in the
96 # output. They are ignored by default.
97 # show_authors = False
98
99 # The name of the Pygments (syntax highlighting) style to use.
100 # pygments_style = "sphinx"
101
102 # A list of ignored prefixes for module index sorting.
103 # modindex_common_prefix = []
104
105 # If true, keep warnings as "system message" paragraphs in the built documents.
106 # keep_warnings = False
107
108
109 # -- Options for HTML output ----------------------------------------------
110
111 # The theme to use for HTML and HTML Help pages. See the documentation for
112 # a list of builtin themes.
113 html_theme = "furo"
114
115 html_theme_options = {
116 "source_repository": "https://github.com/python/mypy",
117 "source_branch": "master",
118 "source_directory": "docs/source",
119 }
120
121 # Theme options are theme-specific and customize the look and feel of a theme
122 # further. For a list of options available for each theme, see the
123 # documentation.
124 # html_theme_options = {}
125
126 # Add any paths that contain custom themes here, relative to this directory.
127 # html_theme_path = []
128
129 # The name for this set of Sphinx documents. If None, it defaults to
130 # "<project> v<release> documentation".
131 # html_title = None
132
133 # A shorter title for the navigation bar. Default is the same as html_title.
134 # html_short_title = None
135
136 # The name of an image file (relative to this directory) to place at the top
137 # of the sidebar.
138 html_logo = "mypy_light.svg"
139
140 # The name of an image file (within the static path) to use as favicon of the
141 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
142 # pixels large.
143 # html_favicon = None
144
145 # Add any paths that contain custom static files (such as style sheets) here,
146 # relative to this directory. They are copied after the builtin static files,
147 # so a file named "default.css" will overwrite the builtin "default.css".
148 # html_static_path = ['_static']
149
150 # Add any extra paths that contain custom files (such as robots.txt or
151 # .htaccess) here, relative to this directory. These files are copied
152 # directly to the root of the documentation.
153 # html_extra_path = []
154
155 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
156 # using the given strftime format.
157 # html_last_updated_fmt = '%b %d, %Y'
158
159 # If true, SmartyPants will be used to convert quotes and dashes to
160 # typographically correct entities.
161 # html_use_smartypants = True
162
163 # Custom sidebar templates, maps document names to template names.
164 # html_sidebars = {}
165
166 # Additional templates that should be rendered to pages, maps page names to
167 # template names.
168 # html_additional_pages = {}
169
170 # If false, no module index is generated.
171 # html_domain_indices = True
172
173 # If false, no index is generated.
174 # html_use_index = True
175
176 # If true, the index is split into individual pages for each letter.
177 # html_split_index = False
178
179 # If true, links to the reST sources are added to the pages.
180 # html_show_sourcelink = True
181
182 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
183 # html_show_sphinx = True
184
185 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
186 # html_show_copyright = True
187
188 # If true, an OpenSearch description file will be output, and all pages will
189 # contain a <link> tag referring to it. The value of this option must be the
190 # base URL from which the finished HTML is served.
191 # html_use_opensearch = ''
192
193 # This is the file name suffix for HTML files (e.g. ".xhtml").
194 # html_file_suffix = None
195
196 # Output file base name for HTML help builder.
197 htmlhelp_basename = "mypydoc"
198
199
200 # -- Options for LaTeX output ---------------------------------------------
201
202 latex_elements = {
203 # The paper size ('letterpaper' or 'a4paper').
204 #'papersize': 'letterpaper',
205 # The font size ('10pt', '11pt' or '12pt').
206 #'pointsize': '10pt',
207 # Additional stuff for the LaTeX preamble.
208 #'preamble': '',
209 }
210
211 # Grouping the document tree into LaTeX files. List of tuples
212 # (source start file, target name, title,
213 # author, documentclass [howto, manual, or own class]).
214 latex_documents = [("index", "Mypy.tex", "Mypy Documentation", "Jukka", "manual")]
215
216 # The name of an image file (relative to this directory) to place at the top of
217 # the title page.
218 # latex_logo = None
219
220 # For "manual" documents, if this is true, then toplevel headings are parts,
221 # not chapters.
222 # latex_use_parts = False
223
224 # If true, show page references after internal links.
225 # latex_show_pagerefs = False
226
227 # If true, show URL addresses after external links.
228 # latex_show_urls = False
229
230 # Documents to append as an appendix to all manuals.
231 # latex_appendices = []
232
233 # If false, no module index is generated.
234 # latex_domain_indices = True
235
236
237 # -- Options for manual page output ---------------------------------------
238
239 # One entry per manual page. List of tuples
240 # (source start file, name, description, authors, manual section).
241 man_pages = [("index", "mypy", "Mypy Documentation", ["Jukka Lehtosalo"], 1)]
242
243 # If true, show URL addresses after external links.
244 # man_show_urls = False
245
246
247 # -- Options for Texinfo output -------------------------------------------
248
249 # Grouping the document tree into Texinfo files. List of tuples
250 # (source start file, target name, title, author,
251 # dir menu entry, description, category)
252 texinfo_documents = [
253 (
254 "index",
255 "Mypy",
256 "Mypy Documentation",
257 "Jukka",
258 "Mypy",
259 "One line description of project.",
260 "Miscellaneous",
261 )
262 ]
263
264 # Documents to append as an appendix to all manuals.
265 # texinfo_appendices = []
266
267 # If false, no module index is generated.
268 # texinfo_domain_indices = True
269
270 # How to display URL addresses: 'footnote', 'no', or 'inline'.
271 # texinfo_show_urls = 'footnote'
272
273 # If true, do not generate a @detailmenu in the "Top" node's menu.
274 # texinfo_no_detailmenu = False
275
276 rst_prolog = ".. |...| unicode:: U+2026 .. ellipsis\n"
277
278 intersphinx_mapping = {
•279 "python": ("/usr/share/doc/python3/html/", None),
280 "attrs": ("/usr/share/doc/python-attr-doc/html/", None),
281 "cython": ("/usr/share/doc/cython3/html/", None),
282 "monkeytype": (
283 "https://monkeytype.readthedocs.io/en/latest",
284 "../../debian/intersphinx/monkeytype_objects.inv"
285 ),
286 "setuptools": ("/usr/share/doc/python-setuptools-doc/html/", None),
287 }
288
289
290 def setup(app: Sphinx) -> None:
291 app.add_object_type(
292 "confval",
293 "confval",
294 objname="configuration value",
295 indextemplate="pair: %s; configuration value",
296 doc_field_types=[
297 Field("type", label="Type", has_arg=False, names=("type",)),
298 Field("default", label="Default", has_arg=False, names=("default",)),
299 ],
300 )