File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 5
5
__version__ = '1.2.2.dev0'
6
6
7
7
8
+ def _verify_sphinx_jinja ():
9
+ """Ensure sphinx and jinja versions are compatible.
10
+
11
+ Jinja2>=3.1 requires Sphinx>=4.0.2. Raises exception if this condition is
12
+ not met.
13
+
14
+ TODO: This check can be removed when the minimum supported sphinx version
15
+ for numpydoc sphinx>=4.0.2
16
+ """
17
+ import sphinx , jinja2
18
+ from packaging import version
19
+
20
+ if version .parse (sphinx .__version__ ) <= version .parse ("4.0.2" ):
21
+ if version .parse (jinja2 .__version__ ) >= version .parse ("3.1" ):
22
+ from sphinx .errors import VersionRequirementError
23
+ raise VersionRequirementError (
24
+ "\n \n Sphinx<4.0.2 is incompatible with Jinja2>=3.1.\n "
25
+ "If you wish to continue using sphinx<4.0.2 you need to pin "
26
+ "Jinja2<3.1."
27
+ )
28
+
29
+
30
+ _verify_sphinx_jinja ()
31
+
32
+
8
33
def setup (app , * args , ** kwargs ):
9
34
from .numpydoc import setup
10
35
return setup (app , * args , ** kwargs )
You can’t perform that action at this time.
0 commit comments