Generate a Python package project using the Python Cookiecutter package
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

304 lines
9.5KB

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # pylint: disable=invalid-name
  4. #
  5. # Configuration file for the Sphinx documentation builder.
  6. #
  7. # This file does only contain a selection of the most common options. For a
  8. # full list see the documentation:
  9. # http://www.sphinx-doc.org/en/master/config
  10. # -- Path setup --------------------------------------------------------------
  11. # If extensions (or modules to document with autodoc) are in another directory,
  12. # add these directories to sys.path here. If the directory is relative to the
  13. # documentation root, use os.path.abspath to make it absolute, like shown here.
  14. #
  15. import os
  16. import sys
  17. # Insert the project root dir as the first element in the PYTHONPATH.
  18. # This lets us ensure that the source package is imported, and that its
  19. # version is used.
  20. # ({{ cookiecutter.project_slug }}/docs/source/conf.py -> {{ cookiecutter.project_slug }}/docs/source -> {{ cookiecutter.project_slug }}/docs -> {{ cookiecutter.project_slug }})
  21. sys.path.insert(
  22. 0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  23. )
  24. import {{ cookiecutter.project_slug }}
  25. # -- Project information -----------------------------------------------------
  26. project = "{{ cookiecutter.project_name }}"
  27. copyright = "{{ cookiecutter.year }}, {{ cookiecutter.full_name }}" # pylint: disable=redefined-builtin
  28. author = {{ cookiecutter.full_name }}
  29. # The version info for the project you're documenting, acts as replacement
  30. # for |version| and |release|, also used in various other places throughout
  31. # the built documents.
  32. #
  33. # The short X.Y version.
  34. version = {{ cookiecutter.project_slug }}.__version__
  35. # The full version, including alpha/beta/rc tags.
  36. release = {{ cookiecutter.project_slug }}.__version__
  37. # -- General configuration ---------------------------------------------------
  38. # If your documentation needs a minimal Sphinx version, state it here.
  39. #
  40. # needs_sphinx = '1.0'
  41. # Add any Sphinx extension module names here, as strings. They can be
  42. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  43. # ones.
  44. extensions = [
  45. "sphinx.ext.autodoc",
  46. "sphinx.ext.doctest",
  47. "sphinx.ext.inheritance_diagram",
  48. "sphinx.ext.intersphinx",
  49. "sphinx.ext.todo",
  50. "sphinx.ext.coverage",
  51. "sphinx.ext.imgmath",
  52. "sphinx.ext.ifconfig",
  53. "sphinx.ext.viewcode",
  54. "sphinx.ext.githubpages",
  55. "sphinx.ext.napoleon",
  56. "sphinx_autodoc_typehints",
  57. "sphinx_automodapi.automodapi",
  58. "sphinx_automodapi.smart_resolver",
  59. ]
  60. # Add any paths that contain templates here, relative to this directory.
  61. templates_path = ["_templates"]
  62. # The suffix(es) of source filenames.
  63. # You can specify multiple suffix as a list of string:
  64. #
  65. # source_suffix = ['.rst', '.md']
  66. source_suffix = ".rst"
  67. # The master toctree document.
  68. master_doc = "index"
  69. # The language for content autogenerated by Sphinx. Refer to documentation
  70. # for a list of supported languages.
  71. #
  72. # This is also used if you do content translation via gettext catalogs.
  73. # Usually you set "language" from the command line for these cases.
  74. language = None
  75. # List of patterns, relative to source directory, that match files and
  76. # directories to ignore when looking for source files.
  77. # This pattern also affects html_static_path and html_extra_path.
  78. exclude_patterns = []
  79. # The name of the Pygments (syntax highlighting) style to use.
  80. pygments_style = "sphinx"
  81. # List of warnings to suppress when generating documentation.
  82. suppress_warnings = [
  83. "misc.highlighting_failure",
  84. "ref.doc",
  85. "ref.numref",
  86. "ref.ref",
  87. "toc.secnum",
  88. ]
  89. # -- Options for HTML output -------------------------------------------------
  90. # The theme to use for HTML and HTML Help pages. See the documentation for
  91. # a list of builtin themes.
  92. #
  93. html_theme = "alabaster"
  94. # Theme options are theme-specific and customize the look and feel of a theme
  95. # further. For a list of options available for each theme, see the
  96. # documentation.
  97. #
  98. # html_theme_options = {}
  99. # Add any paths that contain custom static files (such as style sheets) here,
  100. # relative to this directory. They are copied after the builtin static files,
  101. # so a file named "default.css" will overwrite the builtin "default.css".
  102. html_static_path = ["_static"]
  103. # Custom sidebar templates, must be a dictionary that maps document names
  104. # to template names.
  105. #
  106. # The default sidebars (for documents that don't match any pattern) are
  107. # defined by theme itself. Builtin themes are using these templates by
  108. # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
  109. # 'searchbox.html']``.
  110. #
  111. # html_sidebars = {}
  112. # -- Options for HTMLHelp output ---------------------------------------------
  113. # Output file base name for HTML help builder.
  114. htmlhelp_basename = "{{ cookiecutter.project_slug }}doc"
  115. # -- Options for LaTeX output ------------------------------------------------
  116. latex_elements = {
  117. # The paper size ('letterpaper' or 'a4paper').
  118. #
  119. # 'papersize': 'letterpaper',
  120. # The font size ('10pt', '11pt' or '12pt').
  121. #
  122. # 'pointsize': '10pt',
  123. # Additional stuff for the LaTeX preamble.
  124. #
  125. # 'preamble': '',
  126. # Latex figure (float) alignment
  127. #
  128. # 'figure_align': 'htbp',
  129. }
  130. # Grouping the document tree into LaTeX files. List of tuples
  131. # (source start file, target name, title,
  132. # author, documentclass [howto, manual, or own class]).
  133. latex_documents = [
  134. (
  135. master_doc,
  136. "{{ cookiecutter.project_slug }}.tex",
  137. "{{ cookiecutter.project_name }} Documentation",
  138. "{{ cookiecutter.full_name }}",
  139. "manual",
  140. )
  141. ]
  142. # The name of an image file (relative to this directory) to place at
  143. # the top of the title page.
  144. #latex_logo = None
  145. # For "manual" documents, if this is true, then toplevel headings
  146. # are parts, not chapters.
  147. #latex_use_parts = False
  148. # If true, show page references after internal links.
  149. #latex_show_pagerefs = False
  150. # If true, show URL addresses after external links.
  151. #latex_show_urls = False
  152. # Documents to append as an appendix to all manuals.
  153. #latex_appendices = []
  154. # If false, no module index is generated.
  155. #latex_domain_indices = True
  156. # -- Options for manual page output ------------------------------------------
  157. # One entry per manual page. List of tuples
  158. # (source start file, name, description, authors, manual section).
  159. man_pages = [(master_doc, "{{ cookiecutter.project_slug }}", "{{ cookiecutter.project_name }} Documentation", [author], 1)]
  160. # If true, show URL addresses after external links.
  161. #man_show_urls = False
  162. # -- Options for Texinfo output ----------------------------------------------
  163. # Grouping the document tree into Texinfo files. List of tuples
  164. # (source start file, target name, title, author,
  165. # dir menu entry, description, category)
  166. texinfo_documents = [
  167. (
  168. master_doc,
  169. "{{ cookiecutter.project_slug }}",
  170. "{{ cookiecutter.project_name }} Documentation",
  171. author,
  172. "{{ cookiecutter.project_slug }}",
  173. "{{ cookiecutter.project_short_description }}",
  174. "Miscellaneous",
  175. )
  176. ]
  177. # Documents to append as an appendix to all manuals.
  178. #texinfo_appendices = []
  179. # If false, no module index is generated.
  180. #texinfo_domain_indices = True
  181. # How to display URL addresses: 'footnote', 'no', or 'inline'.
  182. #texinfo_show_urls = 'footnote'
  183. # If true, do not generate a @detailmenu in the "Top" node's menu.
  184. #texinfo_no_detailmenu = False
  185. # -- Options for Epub output -------------------------------------------------
  186. # Bibliographic Dublin Core info.
  187. epub_title = project
  188. # The unique identifier of the text. This can be a ISBN number
  189. # or the project homepage.
  190. #
  191. # epub_identifier = ''
  192. # A unique identification for the text.
  193. #
  194. # epub_uid = ''
  195. # A list of files that should not be packed into the epub file.
  196. epub_exclude_files = ["search.html"]
  197. # -- Extension configuration -------------------------------------------------
  198. # -- Options for intersphinx extension ---------------------------------------
  199. # Example configuration for intersphinx: refer to the Python standard library.
  200. # The URL is the first tuple item. Check with
  201. # "python -m sphinx.ext.intersphinx 'URL/objects.inv'"
  202. # and use the second tuple item to specify the
  203. # name if not the default objects.inv
  204. intersphinx_mapping = {
  205. "arrow": ("https://arrow.readthedocs.io/en/latest/", None),
  206. "py3": ("https://docs.python.org/3", None),
  207. "python": ("https://docs.python.org/3", None),
  208. "requests": ("https://requests.readthedocs.io/en/master/", None),
  209. "six": ("https://six.readthedocs.io/", None),
  210. "urllib3": ("https://urllib3.readthedocs.io/en/latest/", None),
  211. }
  212. # -- Options for todo extension ----------------------------------------------
  213. # If true, `todo` and `todoList` produce output, else they produce nothing.
  214. todo_include_todos = True
  215. # -- Options for autodoc extension -------------------------------------------
  216. autodoc_default_options = {
  217. "member-order": "bysource",
  218. "special-members": "__init__",
  219. "exclude-members": "__weakref__",
  220. "show-inheritance": None,
  221. }
  222. # -- Options for automodapi extension ----------------------------------------
  223. # This is needed to avoid having methods and attributes of classes
  224. # being shown multiple times.
  225. numpydoc_show_class_members = False
  226. # If True, members that a class inherits from a base class are included
  227. # in the generated documentation.
  228. # automodsumm_inherited_members = False
  229. # -- Options for inheritance-graph extension ---------------------------------
  230. inheritance_graph_attrs = dict(
  231. fontsize=14, size=200, splines="spline", ratio="auto", rankdir="LR"
  232. )
  233. inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75)
  234. # Add custom stylesheets
  235. def setup(app):
  236. app.add_css_file("css/coverage.css")