From d3a96a22ce71ef7a53f71f831ec9c3f9aa2f1795 Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Thu, 31 Jan 2019 12:44:40 +0000 Subject: [PATCH] doc: Make conf.py friendlier to RTD Since RTD fails to import lisa for unknown reason, even if it shares the same venv, move the sys.path update before `import lisa`. --- doc/conf.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index c835da8ff..a58e1e426 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,6 +26,12 @@ from docutils import nodes from sphinx.util.docfields import TypedField from sphinx import addnodes +# This shouldn't be needed, as using a virtualenv + setup.py should set up the +# sys.path correctly. However that seems to be half broken on ReadTheDocs, so +# manually set it here +sys.path.insert(0, os.path.abspath('../')) + +# Import our packages after modifying sys.path import lisa # This ugly hack is required because by default TestCase.__module__ is @@ -76,11 +82,6 @@ def patched_make_field(self, types, domain, items, env=None): TypedField.make_field = patched_make_field -# This shouldn't be needed, as using a virtualenv + setup.py should set up the -# sys.path correctly. However that seems to be half broken on ReadTheDocs, so -# manually set it here -sys.path.insert(0, os.path.abspath('../')) - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -- GitLab