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:
2323 python-version : ${{ matrix.python-version }}
2424
2525 - name : Setup environment
26- run : |
27- python -m venv venv
28- source venv/bin/activate
29-
30- - name : Install
3126 run : |
3227 python -m pip install --upgrade pip wheel setuptools
3328 python -m pip install -r requirements/test.txt -r doc/requirements.txt
3429 python -m pip install codecov
3530 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 : |
3640 python -m pip install .
3741 pip list
3842
Original file line number Diff line number Diff line change 55__version__ = '1.2.2.dev0'
66
77
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+
833def setup (app , * args , ** kwargs ):
934 from .numpydoc import setup
1035 return setup (app , * args , ** kwargs )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def read(fname):
4343 author_email = "pav@iki.fi" ,
4444 url = "https://numpydoc.readthedocs.io" ,
4545 license = "BSD" ,
46- install_requires = ["sphinx>=1.8" , 'Jinja2>=2.10,<3.1 ' ],
46+ install_requires = ["sphinx>=1.8" , 'Jinja2>=2.10' ],
4747 python_requires = ">=3.7" ,
4848 extras_require = {
4949 "testing" : [
You can’t perform that action at this time.
0 commit comments