Skip to content

Commit ad79a18

Browse files
Birgit SchachlerBirgit Schachler
authored andcommitted
Add minimum sphinx version and error message
1 parent a18ffa3 commit ad79a18

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import sys
1616
import os
17+
import sphinx
18+
from sphinx.errors import VersionRequirementError
1719

1820
# If extensions (or modules to document with autodoc) are in another directory,
1921
# add these directories to sys.path here. If the directory is relative to the
@@ -23,7 +25,10 @@
2325
# -- General configuration ------------------------------------------------
2426

2527
# If your documentation needs a minimal Sphinx version, state it here.
26-
#needs_sphinx = '1.0'
28+
needs_sphinx = '1.4.3'
29+
if needs_sphinx > sphinx.__display_version__:
30+
message = 'This project needs at least Sphinx v%s' % needs_sphinx
31+
raise VersionRequirementError(message)
2732

2833
# Add any Sphinx extension module names here, as strings. They can be
2934
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom

0 commit comments

Comments
 (0)