Skip to content

Commit 9c59a46

Browse files
authored
MAINT: Compatibility with pydata-sphinx-theme (#453)
Fix compatibility issues between latest pydata-sphinx-theme and sphinx 6. Increase granularity of CI to test across necessary sphinx & Python version combos.
1 parent ef731f0 commit 9c59a46

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ jobs:
1818
os: [Ubuntu]
1919
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
2020
sphinx-version:
21-
["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"]
21+
[
22+
"sphinx==4.2",
23+
"sphinx==4.5",
24+
"sphinx==5.0",
25+
"sphinx==5.3",
26+
"sphinx==6.0",
27+
"sphinx>6.0",
28+
]
29+
exclude:
30+
- os: Ubuntu
31+
python-version: "3.7"
32+
sphinx-version: "sphinx==6.0"
33+
- os: Ubuntu
34+
python-version: "3.7"
35+
sphinx-version: "sphinx>6.0"
2236
steps:
2337
- uses: actions/checkout@v3
2438

doc/conf.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,17 @@
8181

8282
html_theme = "pydata_sphinx_theme"
8383
html_theme_options = {
84-
"github_url": "https://github.com/numpy/numpydoc",
8584
"show_prev_next": False,
86-
"navbar_end": ["search-field.html", "navbar-icon-links.html"],
85+
"navbar_end": ["theme-switcher", "search-field.html", "navbar-icon-links.html"],
86+
"icon_links": [
87+
{
88+
"name": "GitHub",
89+
"url": "https://github.com/numpy/numpydoc",
90+
"icon": "fab fa-github-square",
91+
"type": "fontawesome",
92+
},
93+
],
8794
}
88-
# NOTE: The following is required for supporting of older sphinx toolchains.
89-
# The "theme-switcher" templated should be added directly to navbar_end
90-
# above and the following lines removed when the minimum supported
91-
# version of pydata_sphinx_theme is 0.9.0
92-
# Add version switcher for versions of pydata_sphinx_theme that support it
93-
import packaging
94-
import pydata_sphinx_theme
95-
96-
if packaging.version.parse(pydata_sphinx_theme.__version__) >= packaging.version.parse(
97-
"0.9.0"
98-
):
99-
html_theme_options["navbar_end"].insert(0, "theme-switcher")
100-
10195

10296
html_sidebars = {
10397
"**": [],

requirements/doc.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy>=1.21
22
matplotlib>=3.5
33
pydata-sphinx-theme>=0.11
4-
# TODO: Remove <6 here and in actions when pydata-sphinx-theme handles sphinx 6
5-
sphinx>=5.2,<6
4+
sphinx>=5.2

0 commit comments

Comments
 (0)