Skip to content

Commit

Permalink
Mock docs deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Nicholls committed Apr 16, 2019
1 parent 4427c75 commit 9136da9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
26 changes: 23 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,41 @@

import os
import sys
from unittest.mock import MagicMock

# -- Path setup --------------------------------------------------------------

# 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.
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '../../pytac'))
sys.path.append(os.path.join(os.path.dirname(__file__), '../../at/pyat'))

# -- Mock modules ------------------------------------------------------------

# If we cannot import pytac or at then mock them. This is a temporary fix
# because at is not on pypi.
MOCK_MODULES = []

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

try:
import pytac
except ImportError:
MOCK_MODULES.append('pytac')
try:
import at
except ImportError:
MOCK_MODULES.append('at')

sys.modules.update((mod_name, Mock() for mod_name in MOCK_MODULES)

# -- Project information -----------------------------------------------------

project = u'ATIP'
copyright = u'2018, Tobyn Nicholls'
copyright = u'2019, Tobyn Nicholls'
author = u'Tobyn Nicholls'

# The short X.Y version
Expand Down
3 changes: 0 additions & 3 deletions docs/readthedocs_environment.yml

This file was deleted.

0 comments on commit 9136da9

Please sign in to comment.