From fcb8d6f4c9ab827e549fd7de7383336216e9538e Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavier.robin@unibas.ch> Date: Thu, 19 Dec 2019 16:25:54 +0100 Subject: [PATCH] Revert "Attempt to restore compatibility with older versions of Sphinx" This reverts commit ef7bfdb6c85a4ef9cd1fe886d3dd569c472a0860. Didn't work with Sphinx 1.6.7 which needs an extra option at the start. This needs to be fixed cleanly, or we need to upgrade the Sphinx version requirements --- doc/make.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/make.py b/doc/make.py index cc6cc1feb..426ee6028 100644 --- a/doc/make.py +++ b/doc/make.py @@ -5,12 +5,7 @@ import shutil from ost import settings from optparse import OptionParser import subprocess -try: - # Import for new versions of Sphinx (tested with 2.3.0) - from sphinx.cmd.build import main as sphinx_main -except ImportError: - # Import for older versions of Sphinx (should work with 1.6.7) - from sphinx import main as sphinx_main +import sphinx.cmd.build if len(sys.argv)==2: root_dir=sys.argv[1] @@ -96,14 +91,14 @@ for sub_dir in ('modules',): _CollectRstDocs('doc/source', directory, filenames) if opts.html: - sphinx_main(extra_opts + ['-b', 'html', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) + sphinx.cmd.build.main(extra_opts + ['-b', 'html', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) if opts.doctest: - sphinx_main(extra_opts + ['-b', 'doctest', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) + sphinx.cmd.build.main(extra_opts + ['-b', 'doctest', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) if opts.build_json: - sphinx_main(extra_opts + ['-b', 'json', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) + sphinx.cmd.build.main(extra_opts + ['-b', 'json', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) if opts.linkcheck: - sphinx_main(extra_opts + ['-b', 'linkcheck', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) + sphinx.cmd.build.main(extra_opts + ['-b', 'linkcheck', '-c', 'doc/conf', 'doc/source', 'doc/build/html']) -- GitLab