conf.py 8.7 KB

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