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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
# encoding: utf-8
"""Pykka documentation build configuration file"""
from __future__ import unicode_literals
import os
import re
import sys
# -- Workarounds to have autodoc generate API docs ----------------------------
sys.path.insert(0, os.path.abspath('..'))
class Mock(object):
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return Mock()
@classmethod
def __getattr__(self, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
return type(name, (), {})
else:
return Mock()
MOCK_MODULES = [
'gevent',
'gevent.event',
'gevent.queue',
'eventlet',
'eventlet.event',
'eventlet.queue',
]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
# -- General configuration ----------------------------------------------------
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Pykka'
copyright = u'2010-2015, Stein Magnus Jodal'
def get_version():
init_py = open('../pykka/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
return metadata['version']
release = get_version()
version = '.'.join(release.split('.')[:2])
exclude_patterns = ['_build']
pygments_style = 'sphinx'
modindex_common_prefix = ['pykka.']
# -- Options for HTML output --------------------------------------------------
html_theme = 'default'
html_static_path = ['_static']
html_use_modindex = True
html_use_index = True
html_split_index = False
html_show_sourcelink = True
htmlhelp_basename = 'Pykka'
# -- Options for LaTeX output -------------------------------------------------
latex_documents = [
(
'index',
'Pykka.tex',
'Pykka Documentation',
'Stein Magnus Jodal',
'manual',
),
]
# -- Options for manual page output -------------------------------------------
man_pages = []
# -- Options for autodoc extension --------------------------------------------
autodoc_member_order = 'bysource'
# -- Options for extlink extension --------------------------------------------
extlinks = {
'issue': ('https://github.com/jodal/pykka/issues/%s', '#'),
}
# -- Options for intersphinx extension ----------------------------------------
intersphinx_mapping = {
'python': ('/usr/share/doc/python-doc/html', None),
}
|