1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
# -*- coding: utf-8 -*-
import datetime
import os
import sys
import time
import pkg_resources
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
build_date = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx'
]
def check_object_path(key, url, path):
if os.path.isfile(path):
return {key: (url, path)}
return {}
intersphinx_mapping = {}
intersphinx_mapping.update(check_object_path(
'python',
'https://docs.python.org/{v}/'.format(
v='.'.join(map(str, sys.version_info[0:2]))
),
'/usr/share/doc/python{v}/html/objects.inv'.format(
v='.'.join(map(str, sys.version_info[0:2]))
)
))
intersphinx_mapping.update(check_object_path(
'django',
'https://django.readthedocs.org/en/latest/',
'/usr/share/doc/python-django-doc/html/objects.inv'
))
intersphinx_mapping.update(check_object_path(
'pytest',
'https://docs.pytest.org/en/latest/',
'/usr/share/doc/python-pytest-doc/html/objects.inv'
))
intersphinx_mapping.update(check_object_path(
'sybil',
'http://sybil.readthedocs.io/en/latest/',
'/usr/share/doc/python3-sybil/html/objects.inv'
))
# General
source_suffix = '.txt'
master_doc = 'index'
project = 'testfixtures'
copyright = '2008-2015 Simplistix Ltd, 2016-%s Chris Withers' % build_date.year
version = release = pkg_resources.get_distribution(project).version
exclude_trees = ['_build']
pygments_style = 'sphinx'
# Options for HTML output
html_theme = 'furo'
htmlhelp_basename = project+'doc'
# Options for LaTeX output
latex_documents = [
('index', project+'.tex', project+u' Documentation',
'Simplistix Ltd', 'manual'),
]
exclude_patterns = ['**/furo.js.LICENSE.txt']
nitpicky = True
nitpick_ignore = [
('py:class', 'testfixtures.replace.R'), # type var
('py:class', 'module'), # ModuleType not documented.
('py:class', 'unittest.mock._Call'), # No docstring.
('py:class', 'tempfile.TemporaryFile'), # not documented as a class so type annotation broken
('py:class', 'constantly._constants.NamedConstant'), # twisted logging constants
('py:class', 'py.path.local'), # deprecated and hard to reference
('py:class', 'unittest.case.TestCase'), # no docs, apparently
('py:class', 'twisted.trial.unittest.TestCase'), # twisted doesn't use sphinx
]
|