conf.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # -*- coding: utf-8 -*-
  2. import os
  3. import sys
  4. import datetime
  5. # If extensions (or modules to document with autodoc) are in another directory,
  6. # add these directories to sys.path here. If the directory is relative to the
  7. # documentation root, use os.path.abspath to make it absolute, like shown here.
  8. sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
  9. # Add any Sphinx extension module names here, as strings. They can be extensions
  10. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  11. extensions = [
  12. 'sphinx.ext.doctest',
  13. 'sphinx.ext.intersphinx',
  14. 'pytestdocs',
  15. ]
  16. # Add any paths that contain templates here, relative to this directory.
  17. templates_path = ['_templates']
  18. # The suffix of source filenames.
  19. source_suffix = '.rst'
  20. # The master toctree document.
  21. master_doc = 'index'
  22. # General information about the project.
  23. project = u'pytest-django'
  24. copyright = u'%d, Andreas Pelme and contributors' % datetime.date.today().year
  25. exclude_patterns = ['_build']
  26. pygments_style = 'sphinx'
  27. html_theme = 'sphinx_rtd_theme'
  28. # Output file base name for HTML help builder.
  29. htmlhelp_basename = 'pytest-djangodoc'
  30. intersphinx_mapping = {
  31. 'python': ('https://docs.python.org/3', None),
  32. 'django': ('https://docs.djangoproject.com/en/dev/',
  33. 'https://docs.djangoproject.com/en/dev/_objects/'),
  34. 'pytest': ('https://docs.pytest.org/en/latest/', None),
  35. }
  36. def setup(app):
  37. # Allow linking to pytest's confvals.
  38. app.add_object_type(
  39. "confval",
  40. "pytest-confval",
  41. objname="configuration value",
  42. indextemplate="pair: %s; configuration value",
  43. )