From c31f648e234dabee55eb5931a8b96093a5bb5464 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 2 Oct 2020 15:18:52 +0200 Subject: [PATCH] Trying to fix readthedocs build. --- .readthedocs.yml | 3 +++ doc/conf.py | 13 ++++++++++--- doc/requirements.txt | 0 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .readthedocs.yml create mode 100644 doc/requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..d29701a4f --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,3 @@ +python: + install: + - requirements: doc/requirements.txt diff --git a/doc/conf.py b/doc/conf.py index 4f11df49a..88da60f3d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,11 +11,18 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import unicode_literals - +from unittest.mock import Mock as MagicMock import os +import sys -# import sys + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return MagicMock() + +MOCK_MODULES = ['rrdtool'] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) # 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 diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..e69de29bb