From 023fd73dd181ba2faaf5906e0c0dd98451fa2a5e Mon Sep 17 00:00:00 2001 From: jachiam Date: Thu, 30 Jan 2020 08:31:08 -0800 Subject: [PATCH] Try mock imports for Torch to build docs --- docs/conf.py | 3 ++- docs/docs_requirements.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 1f12b5ab9..3c433d72f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,6 +25,7 @@ sys.path.insert(0, dirname(dirname(__file__))) # Mock mpi4py to get around having to install it on RTD server (which fails) +# Also to mock PyTorch, because it is too large for the RTD server to download from unittest.mock import MagicMock class Mock(MagicMock): @@ -32,7 +33,7 @@ class Mock(MagicMock): def __getattr__(cls, name): return MagicMock() -MOCK_MODULES = ['mpi4py'] +MOCK_MODULES = ['mpi4py', 'torch'] sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) # Finish imports diff --git a/docs/docs_requirements.txt b/docs/docs_requirements.txt index 1dab1dbaa..4217a763b 100644 --- a/docs/docs_requirements.txt +++ b/docs/docs_requirements.txt @@ -13,5 +13,4 @@ sphinx==1.5.6 sphinx-autobuild==0.7.1 sphinx-rtd-theme==0.4.1 tensorflow>=1.8.0,<2.0 -torch==1.3.1 tqdm \ No newline at end of file