Debian Codegraph @

docs/conf.py

raw ◀ ▶
1 Debian patch touch this file
1 #!/usr/bin/env python3
2 #
3 # jupyter_client documentation build configuration file, created by
4 # sphinx-quickstart on Tue May 26 15:41:51 2015.
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 import logging as pylogging
15 import os
16 import os.path as osp
17 import shutil
18
19 from sphinx.util import logging # type:ignore[import-not-found]
20
21 # If extensions (or modules to document with autodoc) are in another directory,
22 # add these directories to sys.path here. If the directory is relative to the
23 # documentation root, use os.path.abspath to make it absolute, like shown here.
24 # sys.path.insert(0, os.path.abspath('.'))
25
26 # -- General configuration ------------------------------------------------
27
28 # If your documentation needs a minimal Sphinx version, state it here.
29 # needs_sphinx = '1.0'
30
31 # Add any Sphinx extension module names here, as strings. They can be
32 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33 # ones.
34 extensions = [
35 "myst_parser",
36 "sphinx.ext.autodoc",
37 "sphinx.ext.intersphinx",
38 "sphinx.ext.napoleon",
39 "sphinxcontrib_github_alt",
40 "sphinx_autodoc_typehints",
41 ]
42
43
44 # Workaround for https://github.com/agronholm/sphinx-autodoc-typehints/issues/123
45 class FilterForIssue123(pylogging.Filter):
46 def filter(self, record: pylogging.LogRecord) -> bool:
47 return not record.getMessage().startswith("Cannot handle as a local function")
48
49
50 logging.getLogger("sphinx_autodoc_typehints").logger.addFilter(FilterForIssue123())
51 # End of a workaround
52
53 try:
54 import enchant # type:ignore[import-not-found] # noqa
55
56 extensions += ["sphinxcontrib.spelling"]
57 except ImportError:
58 pass
59
60 myst_enable_extensions = ["html_image"]
61
62 # Add any paths that contain templates here, relative to this directory.
63 templates_path = ["_templates"]
64
65 # The suffix(es) of source filenames.
66 # You can specify multiple suffix as a list of string:
67 # source_suffix = ['.rst', '.md']
68 source_suffix = {".rst": "restructuredtext"}
69
70 # The encoding of source files.
71 # source_encoding = 'utf-8-sig'
72
73 # The master toctree document.
74 master_doc = "index"
75
76 # General information about the project.
77 project = "jupyter_client"
78 copyright = "2015, Jupyter Development Team"
79 author = "Jupyter Development Team"
80
81 github_project_url = "https://github.com/jupyter/jupyter_client"
82
83 # The version info for the project you're documenting, acts as replacement for
84 # |version| and |release|, also used in various other places throughout the
85 # built documents.
86 #
87 version_ns: dict = {}
88 here = os.path.dirname(__file__)
89 version_py = os.path.join(here, os.pardir, "jupyter_client", "_version.py")
90 with open(version_py) as f:
91 exec(compile(f.read(), version_py, "exec"), version_ns) # noqa
92
93 # The short X.Y version.
94 version = "%i.%i" % version_ns["version_info"][:2]
95 # The full version, including alpha/beta/rc tags.
96 release = version_ns["__version__"]
97
98 # The language for content autogenerated by Sphinx. Refer to documentation
99 # for a list of supported languages.
100 #
101 # This is also used if you do content translation via gettext catalogs.
102 # Usually you set "language" from the command line for these cases.
103 language = "en"
104
105 # There are two options for replacing |today|: either, you set today to some
106 # non-false value, then it is used:
107 # today = ''
108 # Else, today_fmt is used as the format for a strftime call.
109 # today_fmt = '%B %d, %Y'
110
111 # List of patterns, relative to source directory, that match files and
112 # directories to ignore when looking for source files.
113 exclude_patterns = ["_build"]
114
115 # The reST default role (used for this markup: `text`) to use for all
116 # documents.
117 # default_role = None
118
119 # If true, '()' will be appended to :func: etc. cross-reference text.
120 # add_function_parentheses = True
121
122 # If true, the current module name will be prepended to all description
123 # unit titles (such as .. function::).
124 # add_module_names = True
125
126 # If true, sectionauthor and moduleauthor directives will be shown in the
127 # output. They are ignored by default.
128 # show_authors = False
129
130 # The name of the Pygments (syntax highlighting) style to use.
131 pygments_style = "sphinx"
132
133 # A list of ignored prefixes for module index sorting.
134 # modindex_common_prefix = []
135
136 # If true, keep warnings as "system message" paragraphs in the built documents.
137 # keep_warnings = False
138
139 # If true, `todo` and `todoList` produce output, else they produce nothing.
140 todo_include_todos = False
141
142
143 # -- Options for HTML output ----------------------------------------------
144
145 # The theme to use for HTML and HTML Help pages. See the documentation for
146 # a list of builtin themes.
147 html_theme = "pydata_sphinx_theme"
148
149 # Theme options are theme-specific and customize the look and feel of a theme
150 # further. For a list of options available for each theme, see the
151 # documentation.
152 html_theme_options = {"navigation_with_keys": False}
153
154 # Add any paths that contain custom themes here, relative to this directory.
155 # html_theme_path = []
156
157 # The name for this set of Sphinx documents. If None, it defaults to
158 # "<project> v<release> documentation".
159 # html_title = None
160
161 # A shorter title for the navigation bar. Default is the same as html_title.
162 # html_short_title = None
163
164 # The name of an image file (relative to this directory) to place at the top
165 # of the sidebar.
166 # html_logo = None
167
168 # The name of an image file (within the static path) to use as favicon of the
169 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
170 # pixels large.
171 # html_favicon = None
172
173 # Add any paths that contain custom static files (such as style sheets) here,
174 # relative to this directory. They are copied after the builtin static files,
175 # so a file named "default.css" will overwrite the builtin "default.css".
176 # html_static_path = ['_static']
177
178 # Add any extra paths that contain custom files (such as robots.txt or
179 # .htaccess) here, relative to this directory. These files are copied
180 # directly to the root of the documentation.
181 # html_extra_path = []
182
183 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
184 # using the given strftime format.
185 # html_last_updated_fmt = '%b %d, %Y'
186
187 # If true, SmartyPants will be used to convert quotes and dashes to
188 # typographically correct entities.
189 # html_use_smartypants = True
190
191 # Custom sidebar templates, maps document names to template names.
192 # html_sidebars = {}
193
194 # Additional templates that should be rendered to pages, maps page names to
195 # template names.
196 # html_additional_pages = {}
197
198 # If false, no module index is generated.
199 # html_domain_indices = True
200
201 # If false, no index is generated.
202 # html_use_index = True
203
204 # If true, the index is split into individual pages for each letter.
205 # html_split_index = False
206
207 # If true, links to the reST sources are added to the pages.
208 # html_show_sourcelink = True
209
210 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
211 # html_show_sphinx = True
212
213 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
214 # html_show_copyright = True
215
216 # If true, an OpenSearch description file will be output, and all pages will
217 # contain a <link> tag referring to it. The value of this option must be the
218 # base URL from which the finished HTML is served.
219 # html_use_opensearch = ''
220
221 # This is the file name suffix for HTML files (e.g. ".xhtml").
222 # html_file_suffix = None
223
224 # Language to be used for generating the HTML full-text search index.
225 # Sphinx supports the following languages:
226 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
227 # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
228 # html_search_language = 'en'
229
230 # A dictionary with options for the search language support, empty by default.
231 # Now only 'ja' uses this config value
232 # html_search_options = {'type': 'default'}
233
234 # The name of a javascript file (relative to the configuration directory) that
235 # implements a search results scorer. If empty, the default will be used.
236 # html_search_scorer = 'scorer.js'
237
238 # Output file base name for HTML help builder.
239 htmlhelp_basename = "jupyter_clientdoc"
240
241 # -- Options for LaTeX output ---------------------------------------------
242
243 latex_elements: dict = {
244 # The paper size ('letterpaper' or 'a4paper').
245 # 'papersize': 'letterpaper',
246 # The font size ('10pt', '11pt' or '12pt').
247 # 'pointsize': '10pt',
248 # Additional stuff for the LaTeX preamble.
249 # 'preamble': '',
250 # Latex figure (float) alignment
251 # 'figure_align': 'htbp',
252 }
253
254 # Grouping the document tree into LaTeX files. List of tuples
255 # (source start file, target name, title,
256 # author, documentclass [howto, manual, or own class]).
257 latex_documents = [
258 (
259 master_doc,
260 "jupyter_client.tex",
261 "jupyter\\_client Documentation",
262 "Jupyter Development Team",
263 "manual",
264 ),
265 ]
266
267 # The name of an image file (relative to this directory) to place at the top of
268 # the title page.
269 # latex_logo = None
270
271 # For "manual" documents, if this is true, then toplevel headings are parts,
272 # not chapters.
273 # latex_use_parts = False
274
275 # If true, show page references after internal links.
276 # latex_show_pagerefs = False
277
278 # If true, show URL addresses after external links.
279 # latex_show_urls = False
280
281 # Documents to append as an appendix to all manuals.
282 # latex_appendices = []
283
284 # If false, no module index is generated.
285 # latex_domain_indices = True
286
287
288 # -- Options for manual page output ---------------------------------------
289
290 # One entry per manual page. List of tuples
291 # (source start file, name, description, authors, manual section).
292 man_pages = [(master_doc, "jupyter_client", "jupyter_client Documentation", [author], 1)]
293
294 # If true, show URL addresses after external links.
295 # man_show_urls = False
296
297
298 # -- Options for Texinfo output -------------------------------------------
299
300 # Grouping the document tree into Texinfo files. List of tuples
301 # (source start file, target name, title, author,
302 # dir menu entry, description, category)
303 texinfo_documents = [
304 (
305 master_doc,
306 "jupyter_client",
307 "jupyter_client Documentation",
308 author,
309 "jupyter_client",
310 "One line description of project.",
311 "Miscellaneous",
312 ),
313 ]
314
315 # Documents to append as an appendix to all manuals.
316 # texinfo_appendices = []
317
318 # If false, no module index is generated.
319 # texinfo_domain_indices = True
320
321 # How to display URL addresses: 'footnote', 'no', or 'inline'.
322 # texinfo_show_urls = 'footnote'
323
324 # If true, do not generate a @detailmenu in the "Top" node's menu.
325 # texinfo_no_detailmenu = False
326
327
328 # Example configuration for intersphinx: refer to the Python standard library.
•329 intersphinx_mapping = {"ipython": ("file:///usr/share/doc/python-ipython-doc/html/", "/usr/share/doc/python-ipython-doc/html/objects.inv")}
330
331
332 def setup(app: object) -> None:
333 HERE = osp.abspath(osp.dirname(__file__))
334 dest = osp.join(HERE, "changelog.md")
335 shutil.copy(osp.join(HERE, "..", "CHANGELOG.md"), dest)