#209 try the RTD solution with Mock objects

See https://docs.readthedocs.io/en/stable/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
Tested locally ok.
This commit is contained in:
Just van den Broecke
2019-08-20 15:52:41 +02:00
committed by GitHub
parent 1bfe0e3bf4
commit f2cf004d2a
+12
View File
@@ -19,6 +19,18 @@
#
import os
import sys
from unittest.mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['osgeo', 'psycopg2.sql', 'elasticsearch']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
sys.path.insert(0, os.path.abspath('../..'))