Skip to content
Snippets Groups Projects
Commit 8dfd3781 authored by Marina Ganeva's avatar Marina Ganeva
Browse files

Re #23953 use LooseVersion for version comparison

parent a955a771
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,12 @@ import os
from sphinx import __version__ as sphinx_version
import sphinx_bootstrap_theme
from distutils.version import LooseVersion
# -- General configuration ------------------------------------------------
if sphinx_version > "1.6":
if LooseVersion(sphinx_version) > LooseVersion("1.6"):
def setup(app):
"""Called automatically by Sphinx when starting the build process
"""
......@@ -28,7 +29,7 @@ extensions = [
'sphinx.ext.intersphinx'
]
if sphinx_version > "1.8":
if LooseVersion(sphinx_version) > LooseVersion("1.8"):
extensions.append('sphinx.ext.imgmath')
else:
extensions.append('sphinx.ext.pngmath')
......
......@@ -9,6 +9,7 @@ from sphinx import __version__ as sphinx_version
import sphinx_bootstrap_theme # checked at cmake time
import mantid
from mantid.kernel import ConfigService
from distutils.version import LooseVersion
# 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
......@@ -17,7 +18,7 @@ sys.path.insert(0, os.path.abspath(os.path.join('..', 'sphinxext')))
# -- General configuration ------------------------------------------------
if sphinx_version > "1.6":
if LooseVersion(sphinx_version) > LooseVersion("1.6"):
def setup(app):
"""Called automatically by Sphinx when starting the build process
"""
......@@ -38,7 +39,7 @@ extensions = [
'mantiddoc.doctest',
'matplotlib.sphinxext.plot_directive'
]
if sphinx_version > "1.8":
if LooseVersion(sphinx_version) > LooseVersion("1.8"):
extensions.append('sphinx.ext.imgmath')
else:
extensions.append('sphinx.ext.pngmath')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment