Skip to content

Commit

Permalink
doc/manual: mock up external modules for sphinx-autodoc
Browse files Browse the repository at this point in the history
jordens committed Feb 5, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e029ebb commit 50c14db
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ install:
- pip install -e .
script:
- coverage run --source=artiq setup.py test
- make -C doc/manual html || true
- make -C doc/manual html
- cd misoc; python make.py -X ../soc -t artiq build-headers build-bios; cd ..
- make -C soc/runtime
- cd misoc; python make.py -X ../soc -t artiq build-bitstream; cd ..
15 changes: 15 additions & 0 deletions doc/manual/conf.py
Original file line number Diff line number Diff line change
@@ -16,6 +16,21 @@
import sys
import os

from unittest.mock import MagicMock


class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()


mock_modules = ["gbulb", "gi", "gi.repository", "cairoplot", "matplotlib"]

for module in mock_modules:
sys.modules[module] = Mock()


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

0 comments on commit 50c14db

Please sign in to comment.