Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mali-git committed Nov 13, 2018
1 parent 5a98638 commit 7bd2f88
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@
import re
import sys

import mock

sys.path.insert(0, os.path.abspath('../../src'))

# -- Mockup PyTorch to exclude it while compiling the docs--------------------------------------------------------------
MOCK_MODULES = ['torch', 'pykeen',]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
from unittest.mock import MagicMock

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

MOCK_MODULES = ['torch', 'pykeen', 'gobject', 'argparse', 'numpy', 'pandas']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

sys.path.insert(0, os.path.abspath('../../src'))

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

Expand Down

0 comments on commit 7bd2f88

Please sign in to comment.