Newer
Older
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
# -*- coding: utf-8 -*-
import sphinx.environment
from docutils.utils import get_source_line
MOCK_MODULES=[]
def _warn_node(self, msg, node, **kwargs):
if not msg.startswith('nonlocal image URI found:'):
self._warnfunc(msg, '%s:%s' % get_source_line(node), **kwargs)
sphinx.environment.BuildEnvironment.warn_node = _warn_node
def mock_modules():
import sys
from mock import MagicMock
try:
import numpy
except ImportError:
MOCK_MODULES.append('numpy')
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()
def __call__(self, *args, **kwards):
return Mock()
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
print 'mocking {}'.format(MOCK_MODULES)
mock_modules()
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'FORCE'
copyright = u'2017, FORCE Project'
version = '0.1.0'
release = '0.1.0.dev0'
pygments_style = 'sphinx'
html_theme = 'classic'
html_static_path = ['_static']
html_logo = '_static/force_logo.png'
htmlhelp_basename = 'FORCEdoc'
intersphinx_mapping = {'http://docs.python.org/': None}