Skip to content

Commit

Permalink
using fake modules to prevent sphinx from actually importing
Browse files Browse the repository at this point in the history
  • Loading branch information
faroit committed Jun 30, 2016
1 parent 8db74ce commit 123db4f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@
author, 'dsdtools', 'One line description of project.',
'Miscellaneous'),
]

# Fake imports to avoid actually loading NumPy and libsndfile
import fake_numpy
sys.modules['numpy'] = sys.modules['fake_numpy']
import fake_cffi
sys.modules['cffi'] = sys.modules['fake_cffi']
18 changes: 18 additions & 0 deletions docs/fake_cffi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Mock module for Sphinx autodoc."""


class FFI(object):

def cdef(self, _):
pass

def dlopen(self, _):
return self

def string(self, _):
return b'not implemented'

def sf_version_string(self):
return NotImplemented

SFC_GET_FORMAT_INFO = NotImplemented
5 changes: 5 additions & 0 deletions docs/fake_numpy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Mock module for Sphinx autodoc."""


def dtype(_):
return NotImplemented

0 comments on commit 123db4f

Please sign in to comment.