Skip to content

Commit 3513a71

Browse files
Require sphinx>=4.2 (#411)
1 parent 00854d5 commit 3513a71

File tree

5 files changed

+7
-100
lines changed

5 files changed

+7
-100
lines changed

.github/workflows/test.yml

+4-71
Original file line numberDiff line numberDiff line change
@@ -12,72 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [Ubuntu]
15-
python-version: ["3.7", "3.8", "3.9"]
16-
sphinx-version:
17-
[
18-
"sphinx==3.0",
19-
"sphinx==3.5",
20-
"sphinx==4.0",
21-
"sphinx==4.5",
22-
"sphinx==5.0",
23-
"sphinx>=5.0",
24-
]
25-
steps:
26-
- uses: actions/checkout@v3
27-
28-
- name: Python setup
29-
uses: actions/setup-python@v4
30-
with:
31-
python-version: ${{ matrix.python-version }}
32-
33-
- name: Setup environment
34-
run: |
35-
python -m pip install --upgrade pip wheel setuptools
36-
python -m pip install -r requirements/test.txt -r doc/requirements.txt
37-
python -m pip install codecov
38-
python -m pip install ${{ matrix.sphinx-version }}
39-
python -m pip list
40-
41-
- name: Downgrade Jinja2 for sphinx<4
42-
if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2'
43-
run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0 docutils==0.17.1
44-
45-
- name: Install
46-
run: |
47-
python -m pip install .
48-
pip list
49-
50-
- name: Run test suite
51-
run: |
52-
pytest -v --pyargs .
53-
54-
- name: Test coverage
55-
run: |
56-
codecov
57-
58-
- name: Make sure CLI works
59-
run: |
60-
python -m numpydoc numpydoc.tests.test_main._capture_stdout
61-
echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash
62-
python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout
63-
echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash
64-
65-
- name: Setup for doc build
66-
run: |
67-
sudo apt-get update
68-
sudo apt install texlive texlive-latex-extra latexmk dvipng
69-
70-
- name: Build documentation
71-
run: |
72-
make -C doc html SPHINXOPTS="-nT"
73-
make -C doc latexpdf SPHINXOPTS="-nT"
74-
75-
test-new:
76-
runs-on: ${{ matrix.os }}-latest
77-
strategy:
78-
matrix:
79-
os: [Ubuntu]
80-
python-version: ["3.10"]
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
8116
sphinx-version:
8217
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
8318
steps:
@@ -125,13 +60,15 @@ jobs:
12560
run: |
12661
make -C doc html SPHINXOPTS="-nT"
12762
make -C doc latexpdf SPHINXOPTS="-nT"
63+
12864
base:
12965
runs-on: ${{ matrix.os }}-latest
13066
strategy:
13167
matrix:
13268
os: [ubuntu, macos, windows]
13369
python-version: ["3.11-dev"]
134-
sphinx-version: ["sphinx==4.0", "sphinx==4.5"]
70+
sphinx-version:
71+
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
13572
steps:
13673
- uses: actions/checkout@v3
13774

@@ -147,10 +84,6 @@ jobs:
14784
python -m pip install ${{ matrix.sphinx-version }}
14885
python -m pip list
14986
150-
- name: Downgrade Jinja2 for sphinx<4
151-
if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2'
152-
run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0
153-
15487
- name: Install
15588
run: |
15689
python -m pip install .

README.rst

+1-1
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.2+.
2222

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

doc/install.rst

+1-1
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.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

-26
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

+1-1
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.2", "Jinja2>=2.10"],
5656
python_requires=">=3.7",
5757
extras_require={
5858
"testing": [

0 commit comments

Comments
 (0)