Debian Codegraph @

doc/conf.py

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #
2 # pyOpenSSL documentation build configuration file, created by
3 # sphinx-quickstart on Sat Jul 16 07:12:22 2011.
4 #
5 # This file is execfile()d with the current directory set to its parent dir.
6 #
7 # Note that not all possible configuration values are present in this
8 # autogenerated file.
9 #
10 # All configuration values have a default; values that are commented out
11 # serve to show the default.
12
13 import codecs
14 import os
15 import re
16 import sys
17
18 HERE = os.path.abspath(os.path.dirname(__file__))
19
20
21 def read_file(*parts):
22 """
23 Build an absolute path from *parts* and return the contents of the
24 resulting file. Assume UTF-8 encoding.
25 """
26 with codecs.open(os.path.join(HERE, *parts), "rb", "ascii") as f:
27 return f.read()
28
29
30 def find_version(*file_paths):
31 version_file = read_file(*file_paths)
32 version_match = re.search(
33 r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M
34 )
35 if version_match:
36 return version_match.group(1)
37 raise RuntimeError("Unable to find version string.")
38
39
40 DOC_DIR = os.path.abspath(os.path.dirname(__file__))
41 sys.path.insert(0, os.path.abspath(os.path.join(DOC_DIR, "..")))
42
43 # If extensions (or modules to document with autodoc) are in another directory,
44 # add these directories to sys.path here. If the directory is relative to the
45 # documentation root, use os.path.abspath to make it absolute, like shown here.
46 # sys.path.insert(0, os.path.abspath('.'))
47
48 # -- General configuration ----------------------------------------------------
49
50 # If your documentation needs a minimal Sphinx version, state it here.
51 needs_sphinx = "1.0"
52
53 # Add any Sphinx extension module names here, as strings. They can be
54 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
55 extensions = [
56 "sphinx.ext.autodoc",
57 "sphinx.ext.intersphinx",
58 ]
59
60 # Add any paths that contain templates here, relative to this directory.
61 templates_path = ["_templates"]
62
63 # The suffix of source filenames.
64 source_suffix = ".rst"
65
66 # The encoding of source files.
67 # source_encoding = 'utf-8-sig'
68
69 # The master toctree document.
70 master_doc = "index"
71
72 # General information about the project.
73 project = "pyOpenSSL"
74 authors = "The pyOpenSSL developers"
75 copyright = "2001 " + authors
76
77 # The version info for the project you're documenting, acts as replacement for
78 # |version| and |release|, also used in various other places throughout the
79 # built documents.
80 #
81 # The short X.Y version.
82 version = find_version("..", "src", "OpenSSL", "version.py")
83 # The full version, including alpha/beta/rc tags.
84 release = version
85
86 # The language for content autogenerated by Sphinx. Refer to documentation
87 # for a list of supported languages.
88 # language = None
89
90 # There are two options for replacing |today|: either, you set today to some
91 # non-false value, then it is used:
92 # today = ''
93 # Else, today_fmt is used as the format for a strftime call.
94 # today_fmt = '%B %d, %Y'
95
96 # List of patterns, relative to source directory, that match files and
97 # directories to ignore when looking for source files.
98 exclude_patterns = ["_build"]
99
100 # The reST default role (used for this markup `text`) to use for all documents.
101 # default_role = None
102
103 # If true, '()' will be appended to :func: etc. cross-reference text.
104 # add_function_parentheses = True
105
106 # If true, the current module name will be prepended to all description
107 # unit titles (such as .. function::).
108 # add_module_names = True
109
110 # If true, sectionauthor and moduleauthor directives will be shown in the
111 # output. They are ignored by default.
112 # show_authors = False
113
114 # The name of the Pygments (syntax highlighting) style to use.
115 pygments_style = "sphinx"
116
117 # A list of ignored prefixes for module index sorting.
118 # modindex_common_prefix = []
119
120
121 # -- Options for HTML output --------------------------------------------------
122
123 # The theme to use for HTML and HTML Help pages. See the documentation for
124 # a list of builtin themes.
125 if os.environ.get("READTHEDOCS", None) == "True":
126 html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
127
128 if "html_context" not in globals():
129 html_context = {}
130 html_context["READTHEDOCS"] = True
131
132 html_theme = "sphinx_rtd_theme"
133
134 # Theme options are theme-specific and customize the look and feel of a theme
135 # further. For a list of options available for each theme, see the
136 # documentation.
137 # html_theme_options = {}
138
139 # Add any paths that contain custom themes here, relative to this directory.
140 # html_theme_path = []
141
142 # The name for this set of Sphinx documents. If None, it defaults to
143 # "<project> v<release> documentation".
144 # html_title = None
145
146 # A shorter title for the navigation bar. Default is the same as html_title.
147 # html_short_title = None
148
149 # The name of an image file (relative to this directory) to place at the top
150 # of the sidebar.
151 # html_logo = None
152
153 # The name of an image file (within the static path) to use as favicon of the
154 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
155 # pixels large.
156 # html_favicon = None
157
158 # Add any paths that contain custom static files (such as style sheets) here,
159 # relative to this directory. They are copied after the builtin static files,
160 # so a file named "default.css" will overwrite the builtin "default.css".
161 # html_static_path = ['_static']
162
163 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
164 # using the given strftime format.
165 # html_last_updated_fmt = '%b %d, %Y'
166
167 # If true, SmartyPants will be used to convert quotes and dashes to
168 # typographically correct entities.
169 # html_use_smartypants = True
170
171 # Custom sidebar templates, maps document names to template names.
172 # html_sidebars = {}
173
174 # Additional templates that should be rendered to pages, maps page names to
175 # template names.
176 # html_additional_pages = {}
177
178 # If false, no module index is generated.
179 # html_domain_indices = True
180
181 # If false, no index is generated.
182 # html_use_index = True
183
184 # If true, the index is split into individual pages for each letter.
185 # html_split_index = False
186
187 # If true, links to the reST sources are added to the pages.
188 # html_show_sourcelink = True
189
190 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
191 # html_show_sphinx = True
192
193 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
194 # html_show_copyright = True
195
196 # If true, an OpenSearch description file will be output, and all pages will
197 # contain a <link> tag referring to it. The value of this option must be the
198 # base URL from which the finished HTML is served.
199 # html_use_opensearch = ''
200
201 # This is the file name suffix for HTML files (e.g. ".xhtml").
202 # html_file_suffix = None
203
204 # Output file base name for HTML help builder.
205 htmlhelp_basename = "pyOpenSSLdoc"
206
207
208 # -- Options for LaTeX output -------------------------------------------------
209
210 # The paper size ('letter' or 'a4').
211 # latex_paper_size = 'letter'
212
213 # The font size ('10pt', '11pt' or '12pt').
214 # latex_font_size = '10pt'
215
216 # Grouping the document tree into LaTeX files. List of tuples
217 # (source start file, target name, title, author, documentclass [howto/manual])
218 latex_documents = [
219 ("index", "pyOpenSSL.tex", "pyOpenSSL Documentation", authors, "manual"),
220 ]
221
222 # The name of an image file (relative to this directory) to place at the top of
223 # the title page.
224 # latex_logo = None
225
226 # For "manual" documents, if this is true, then toplevel headings are parts,
227 # not chapters.
228 # latex_use_parts = False
229
230 # If true, show page references after internal links.
231 # latex_show_pagerefs = False
232
233 # If true, show URL addresses after external links.
234 # latex_show_urls = False
235
236 # Additional stuff for the LaTeX preamble.
237 # latex_preamble = ''
238
239 # Documents to append as an appendix to all manuals.
240 # latex_appendices = []
241
242 # If false, no module index is generated.
243 # latex_domain_indices = True
244
245
246 # -- Options for manual page output -------------------------------------------
247
248 # One entry per manual page. List of tuples
249 # (source start file, name, description, authors, manual section).
250 man_pages = [("index", "pyopenssl", "pyOpenSSL Documentation", [authors], 1)]
251
252 intersphinx_mapping = {
253 "python": ("https://docs.python.org/3", None),
254 "cryptography": ("https://cryptography.io/en/latest/", None),
255 }