File tree Expand file tree Collapse file tree 3 files changed +35
-6
lines changed Expand file tree Collapse file tree 3 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,20 @@ jobs:
23
23
python-version : ${{ matrix.python-version }}
24
24
25
25
- name : Setup environment
26
- run : |
27
- python -m venv venv
28
- source venv/bin/activate
29
-
30
- - name : Install
31
26
run : |
32
27
python -m pip install --upgrade pip wheel setuptools
33
28
python -m pip install -r requirements/test.txt -r doc/requirements.txt
34
29
python -m pip install codecov
35
30
python -m pip install ${{ matrix.sphinx-version }}
31
+ python -m pip list
32
+
33
+ - name : Downgrade Jinja2 for sphinx<4
34
+ if : (${{ matrix.sphinx-version }} == 'sphinx==1.8.0') ||
35
+ (${{ matrix.sphinx-version }} == 'sphinx==2.1')
36
+ run : python -m pip install jinja2==3.0.3
37
+
38
+ - name : Install
39
+ run : |
36
40
python -m pip install .
37
41
pip list
38
42
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 )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def read(fname):
43
43
author_email = "pav@iki.fi" ,
44
44
url = "https://numpydoc.readthedocs.io" ,
45
45
license = "BSD" ,
46
- install_requires = ["sphinx>=1.8" , 'Jinja2>=2.10,<3.1 ' ],
46
+ install_requires = ["sphinx>=1.8" , 'Jinja2>=2.10' ],
47
47
python_requires = ">=3.7" ,
48
48
extras_require = {
49
49
"testing" : [
You can’t perform that action at this time.
0 commit comments