Skip to content

Commit 6108474

Browse files
committed
Require sphinx>4
1 parent a134280 commit 6108474

File tree

5 files changed

+7
-39
lines changed

5 files changed

+7
-39
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
matrix:
1414
os: [Ubuntu]
1515
python-version: ["3.7", "3.8", "3.9", "3.10"]
16-
sphinx-version: ["sphinx==3.0", "sphinx==4.0", "sphinx>4.4"]
16+
sphinx-version:
17+
["sphinx==4.0.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
1718
steps:
1819
- uses: actions/checkout@v3
1920

@@ -30,10 +31,6 @@ jobs:
3031
python -m pip install ${{ matrix.sphinx-version }}
3132
python -m pip list
3233
33-
- name: Downgrade Jinja2 for sphinx<4
34-
if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2'
35-
run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0
36-
3734
- name: Install
3835
run: |
3936
python -m pip install .
@@ -70,7 +67,8 @@ jobs:
7067
matrix:
7168
os: [ubuntu, macos, windows]
7269
python-version: ["3.11-dev"]
73-
sphinx-version: ["sphinx==4.0", "sphinx==4.5"]
70+
sphinx-version:
71+
["sphinx==4.0.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
7472
steps:
7573
- uses: actions/checkout@v3
7674

@@ -86,10 +84,6 @@ jobs:
8684
python -m pip install ${{ matrix.sphinx-version }}
8785
python -m pip list
8886
89-
- name: Downgrade Jinja2 for sphinx<4
90-
if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2'
91-
run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0
92-
9387
- name: Install
9488
run: |
9589
python -m pip install .

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ docstrings formatted according to the NumPy documentation format.
1818
The extension also adds the code description directives
1919
``np:function``, ``np-c:function``, etc.
2020

21-
numpydoc requires Python 3.7+ and sphinx 3.0+.
21+
numpydoc requires Python 3.7+ and sphinx 4.0.2+.
2222

2323
For usage information, please refer to the `documentation
2424
<https://numpydoc.readthedocs.io/>`_.

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Getting started
55
Installation
66
============
77

8-
This extension requires Python 3.7+, sphinx 3.0+ and is available from:
8+
This extension requires Python 3.7+, sphinx 4.0.2+ and is available from:
99

1010
* `numpydoc on PyPI <http://pypi.python.org/pypi/numpydoc>`_
1111
* `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_

numpydoc/__init__.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,6 @@
55
from ._version import __version__
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-
24-
raise VersionRequirementError(
25-
"\n\nSphinx<4.0.2 is incompatible with Jinja2>=3.1.\n"
26-
"If you wish to continue using sphinx<4.0.2 you need to pin "
27-
"Jinja2<3.1."
28-
)
29-
30-
31-
_verify_sphinx_jinja()
32-
33-
348
def setup(app, *args, **kwargs):
359
from .numpydoc import setup
3610

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def read(fname):
5252
author_email="[email protected]",
5353
url="https://numpydoc.readthedocs.io",
5454
license="BSD",
55-
install_requires=["sphinx>=3.0", "Jinja2>=2.10"],
55+
install_requires=["sphinx>=4.0.2", "Jinja2>=2.10"],
5656
python_requires=">=3.7",
5757
extras_require={
5858
"testing": [

0 commit comments

Comments
 (0)