| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# |
| 3 |
# PyCryptodome documentation build configuration file, created by |
| 4 |
# sphinx-quickstart on Sun Jun 8 20:21:20 2014. |
| 5 |
# |
| 6 |
# This file is execfile()d with the current directory set to its containing dir. |
| 7 |
# |
| 8 |
# Note that not all possible configuration values are present in this |
| 9 |
# autogenerated file. |
| 10 |
# |
| 11 |
# All configuration values have a default; values that are commented out |
| 12 |
# serve to show the default. |
| 13 |
|
| 14 |
import sys, os |
| 15 |
|
| 16 |
# Modules to document with autodoc are in another directory |
| 17 |
sys.path.insert(0, os.path.abspath('../lib')) |
| 18 |
print(sys.path) |
| 19 |
|
| 20 |
# Mock existence of native modules |
| 21 |
from Crypto.Util import _raw_api |
| 22 |
|
| 23 |
class MockLib(object): |
| 24 |
ghash_portable = None |
| 25 |
ghash_expand_portable = None |
| 26 |
ghash_destroy_portable = None |
| 27 |
ghash_clmul = None |
| 28 |
ghash_expand_clmul = None |
| 29 |
ghash_destroy_clmul = None |
| 30 |
def have_aes_ni(self): |
| 31 |
return True |
| 32 |
have_clmul = have_aes_ni |
| 33 |
ec_ws_new_context = lambda *x: 0 |
| 34 |
ec_free_context = lambda *x: None |
| 35 |
ec_ws_new_point = lambda *x: 0 |
| 36 |
ec_ws_free_point = lambda *x: None |
| 37 |
ed25519_new_point = lambda *x: 0 |
| 38 |
ed25519_free_point = lambda *x: None |
| 39 |
ed25519_new_point = lambda *x: 0 |
| 40 |
ed448_new_context = lambda *x: 0 |
| 41 |
ed448_free_context = lambda *x: 0 |
| 42 |
ed448_new_point = lambda *x: 0 |
| 43 |
ed448_free_point = lambda *x: 0 |
| 44 |
|
| 45 |
_raw_api.load_pycryptodome_raw_lib = lambda name, cdec: MockLib() |
| 46 |
|
| 47 |
# -- General configuration ----------------------------------------------------- |
| 48 |
|
| 49 |
# If your documentation needs a minimal Sphinx version, state it here. |
| 50 |
#needs_sphinx = '1.0' |
| 51 |
|
| 52 |
# Add any Sphinx extension module names here, as strings. They can be extensions |
| 53 |
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
| 54 |
extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', |
| 55 |
'sphinx.ext.mathjax' ] |
| 56 |
|
| 57 |
# Add any paths that contain templates here, relative to this directory. |
| 58 |
templates_path = ['_templates'] |
| 59 |
|
| 60 |
# The suffix of source filenames. |
| 61 |
source_suffix = '.rst' |
| 62 |
|
| 63 |
# The encoding of source files. |
| 64 |
#source_encoding = 'utf-8-sig' |
| 65 |
|
| 66 |
# The master toctree document. |
| 67 |
master_doc = 'index' |
| 68 |
|
| 69 |
# General information about the project. |
| 70 |
project = 'PyCryptodome' |
| 71 |
copyright = '2022, Helder Eijs' |
| 72 |
|
| 73 |
# The version info for the project you're documenting, acts as replacement for |
| 74 |
# |version| and |release|, also used in various other places throughout the |
| 75 |
# built documents. |
| 76 |
# |
| 77 |
|
| 78 |
for line in open(os.path.join("..", "lib", "Crypto", "__init__.py")): |
| 79 |
if line.startswith("version_info"): |
| 80 |
version_tuple = eval(line.split("=")[1]) |
| 81 |
|
| 82 |
version = release = "%d.%d" % version_tuple[:-1] |
| 83 |
if version_tuple[2] is not None: |
| 84 |
if str(version_tuple[2]).isdigit(): |
| 85 |
release += "." |
| 86 |
release += str(version_tuple[2]) |
| 87 |
|
| 88 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 89 |
# for a list of supported languages. |
| 90 |
#language = None |
| 91 |
|
| 92 |
# There are two options for replacing |today|: either, you set today to some |
| 93 |
# non-false value, then it is used: |
| 94 |
#today = '' |
| 95 |
# Else, today_fmt is used as the format for a strftime call. |
| 96 |
#today_fmt = '%B %d, %Y' |
| 97 |
|
| 98 |
# List of patterns, relative to source directory, that match files and |
| 99 |
# directories to ignore when looking for source files. |
| 100 |
exclude_patterns = ['_build'] |
| 101 |
|
| 102 |
# The reST default role (used for this markup: `text`) to use for all documents. |
| 103 |
#default_role = None |
| 104 |
|
| 105 |
# If true, '()' will be appended to :func: etc. cross-reference text. |
| 106 |
#add_function_parentheses = True |
| 107 |
|
| 108 |
# If true, the current module name will be prepended to all description |
| 109 |
# unit titles (such as .. function::). |
| 110 |
#add_module_names = True |
| 111 |
|
| 112 |
# If true, sectionauthor and moduleauthor directives will be shown in the |
| 113 |
# output. They are ignored by default. |
| 114 |
#show_authors = False |
| 115 |
|
| 116 |
# The name of the Pygments (syntax highlighting) style to use. |
| 117 |
pygments_style = 'sphinx' |
| 118 |
|
| 119 |
# A list of ignored prefixes for module index sorting. |
| 120 |
#modindex_common_prefix = [] |
| 121 |
|
| 122 |
# If True, tables and code-blocks are automatically numbered if they have a caption. The numref role is enabled. |
| 123 |
numfig = True |
| 124 |
|
| 125 |
# -- Options for HTML output --------------------------------------------------- |
| 126 |
|
| 127 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 128 |
# a list of builtin themes. |
| 129 |
html_theme = 'sphinx_rtd_theme' |
| 130 |
|
| 131 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 132 |
# further. For a list of options available for each theme, see the |
| 133 |
# documentation. |
| 134 |
html_theme_options = { |
| 135 |
'navigation_depth' : 5, |
| 136 |
} |
| 137 |
|
| 138 |
# Add any paths that contain custom themes here, relative to this directory. |
| 139 |
html_theme_path = [ "." ] |
| 140 |
|
| 141 |
# The name for this set of Sphinx documents. If None, it defaults to |
| 142 |
# "<project> v<release> documentation". |
| 143 |
#html_title = None |
| 144 |
|
| 145 |
# A shorter title for the navigation bar. Default is the same as html_title. |
| 146 |
#html_short_title = None |
| 147 |
|
| 148 |
# The name of an image file (relative to this directory) to place at the top |
| 149 |
# of the sidebar. |
| 150 |
#html_logo = None |
| 151 |
|
| 152 |
# The name of an image file (within the static path) to use as favicon of the |
| 153 |
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 154 |
# pixels large. |
| 155 |
#html_favicon = None |
| 156 |
|
| 157 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 158 |
# relative to this directory. They are copied after the builtin static files, |
| 159 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 160 |
html_static_path = ['_static'] |
| 161 |
|
| 162 |
# Ensure that text wrapping works in a table, by overring some CSS. |
| 163 |
# See https://github.com/rtfd/sphinx_rtd_theme/issues/117 |
| 164 |
def setup(app): |
| 165 |
app.add_css_file('theme_overrides.css') |
| 166 |
|
| 167 |
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 168 |
# using the given strftime format. |
| 169 |
#html_last_updated_fmt = '%b %d, %Y' |
| 170 |
|
| 171 |
# If true, SmartyPants will be used to convert quotes and dashes to |
| 172 |
# typographically correct entities. |
| 173 |
#html_use_smartypants = True |
| 174 |
|
| 175 |
# Custom sidebar templates, maps document names to template names. |
| 176 |
#html_sidebars = {} |
| 177 |
html_sidebars = { |
| 178 |
'**': [ |
| 179 |
'about.html', 'navigation.html', 'searchbox.html', |
| 180 |
'donate.html', |
| 181 |
] |
| 182 |
} |
| 183 |
|
| 184 |
# Additional templates that should be rendered to pages, maps page names to |
| 185 |
# template names. |
| 186 |
#html_additional_pages = {} |
| 187 |
|
| 188 |
# If false, no module index is generated. |
| 189 |
#html_domain_indices = True |
| 190 |
|
| 191 |
# If false, no index is generated. |
| 192 |
#html_use_index = True |
| 193 |
|
| 194 |
# If true, the index is split into individual pages for each letter. |
| 195 |
#html_split_index = False |
| 196 |
|
| 197 |
# If true, links to the reST sources are added to the pages. |
| 198 |
#html_show_sourcelink = True |
| 199 |
|
| 200 |
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
| 201 |
#html_show_sphinx = True |
| 202 |
|
| 203 |
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
| 204 |
html_show_copyright = False |
| 205 |
|
| 206 |
# If true, an OpenSearch description file will be output, and all pages will |
| 207 |
# contain a <link> tag referring to it. The value of this option must be the |
| 208 |
# base URL from which the finished HTML is served. |
| 209 |
#html_use_opensearch = '' |
| 210 |
|
| 211 |
# This is the file name suffix for HTML files (e.g. ".xhtml"). |
| 212 |
#html_file_suffix = None |
| 213 |
|
| 214 |
# Output file base name for HTML help builder. |
| 215 |
htmlhelp_basename = 'PyCryptodomedoc' |
| 216 |
|
| 217 |
|
| 218 |
# -- Options for LaTeX output -------------------------------------------------- |
| 219 |
|
| 220 |
latex_elements = { |
| 221 |
# The paper size ('letterpaper' or 'a4paper'). |
| 222 |
#'papersize': 'letterpaper', |
| 223 |
|
| 224 |
# The font size ('10pt', '11pt' or '12pt'). |
| 225 |
#'pointsize': '10pt', |
| 226 |
|
| 227 |
# Additional stuff for the LaTeX preamble. |
| 228 |
#'preamble': '', |
| 229 |
} |
| 230 |
|
| 231 |
# Grouping the document tree into LaTeX files. List of tuples |
| 232 |
# (source start file, target name, title, author, documentclass [howto/manual]). |
| 233 |
latex_documents = [ |
| 234 |
('index', 'PyCryptodome.tex', 'PyCryptodome Documentation', |
| 235 |
'Legrandin', 'manual'), |
| 236 |
] |
| 237 |
|
| 238 |
# The name of an image file (relative to this directory) to place at the top of |
| 239 |
# the title page. |
| 240 |
#latex_logo = None |
| 241 |
|
| 242 |
# For "manual" documents, if this is true, then toplevel headings are parts, |
| 243 |
# not chapters. |
| 244 |
#latex_use_parts = False |
| 245 |
|
| 246 |
# If true, show page references after internal links. |
| 247 |
#latex_show_pagerefs = False |
| 248 |
|
| 249 |
# If true, show URL addresses after external links. |
| 250 |
#latex_show_urls = False |
| 251 |
|
| 252 |
# Documents to append as an appendix to all manuals. |
| 253 |
#latex_appendices = [] |
| 254 |
|
| 255 |
# If false, no module index is generated. |
| 256 |
#latex_domain_indices = True |
| 257 |
|
| 258 |
|
| 259 |
# -- Options for manual page output -------------------------------------------- |
| 260 |
|
| 261 |
# One entry per manual page. List of tuples |
| 262 |
# (source start file, name, description, authors, manual section). |
| 263 |
man_pages = [ |
| 264 |
('index', 'pycryptodome', 'PyCryptodome Documentation', |
| 265 |
['Legrandin'], 1) |
| 266 |
] |
| 267 |
|
| 268 |
# If true, show URL addresses after external links. |
| 269 |
#man_show_urls = False |
| 270 |
|
| 271 |
|
| 272 |
# -- Options for Texinfo output ------------------------------------------------ |
| 273 |
|
| 274 |
# Grouping the document tree into Texinfo files. List of tuples |
| 275 |
# (source start file, target name, title, author, |
| 276 |
# dir menu entry, description, category) |
| 277 |
texinfo_documents = [ |
| 278 |
('index', 'PyCryptodome', 'PyCryptodome Documentation', |
| 279 |
'Legrandin', 'PyCryptodome', 'One line description of project.', |
| 280 |
'Miscellaneous'), |
| 281 |
] |
| 282 |
|
| 283 |
# Documents to append as an appendix to all manuals. |
| 284 |
#texinfo_appendices = [] |
| 285 |
|
| 286 |
# If false, no module index is generated. |
| 287 |
#texinfo_domain_indices = True |
| 288 |
|
| 289 |
# How to display URL addresses: 'footnote', 'no', or 'inline'. |
| 290 |
#texinfo_show_urls = 'footnote' |