diff options
author | Eric Larson <larson.eric.d@gmail.com> | 2023-03-03 13:24:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-03 10:24:14 -0800 |
commit | 9c59a469e5fddd688a62f953ac6c228e547b7a00 (patch) | |
tree | b61c773950e4e0a68359cb25152e3e630032483c | |
parent | ef731f09e34580e5c981460978ab1120d7b04d25 (diff) | |
download | numpydoc-9c59a469e5fddd688a62f953ac6c228e547b7a00.tar.gz |
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.
-rw-r--r-- | .github/workflows/test.yml | 16 | ||||
-rw-r--r-- | doc/conf.py | 24 | ||||
-rw-r--r-- | requirements/doc.txt | 3 |
3 files changed, 25 insertions, 18 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d7e1d4..1c7dbd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,21 @@ jobs: os: [Ubuntu] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] sphinx-version: - ["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"] + [ + "sphinx==4.2", + "sphinx==4.5", + "sphinx==5.0", + "sphinx==5.3", + "sphinx==6.0", + "sphinx>6.0", + ] + exclude: + - os: Ubuntu + python-version: "3.7" + sphinx-version: "sphinx==6.0" + - os: Ubuntu + python-version: "3.7" + sphinx-version: "sphinx>6.0" steps: - uses: actions/checkout@v3 diff --git a/doc/conf.py b/doc/conf.py index 560334d..315bac7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -81,23 +81,17 @@ pygments_style = "sphinx" html_theme = "pydata_sphinx_theme" html_theme_options = { - "github_url": "https://github.com/numpy/numpydoc", "show_prev_next": False, - "navbar_end": ["search-field.html", "navbar-icon-links.html"], + "navbar_end": ["theme-switcher", "search-field.html", "navbar-icon-links.html"], + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/numpy/numpydoc", + "icon": "fab fa-github-square", + "type": "fontawesome", + }, + ], } -# NOTE: The following is required for supporting of older sphinx toolchains. -# The "theme-switcher" templated should be added directly to navbar_end -# above and the following lines removed when the minimum supported -# version of pydata_sphinx_theme is 0.9.0 -# Add version switcher for versions of pydata_sphinx_theme that support it -import packaging -import pydata_sphinx_theme - -if packaging.version.parse(pydata_sphinx_theme.__version__) >= packaging.version.parse( - "0.9.0" -): - html_theme_options["navbar_end"].insert(0, "theme-switcher") - html_sidebars = { "**": [], diff --git a/requirements/doc.txt b/requirements/doc.txt index dfc68f9..643fc9a 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,5 +1,4 @@ numpy>=1.21 matplotlib>=3.5 pydata-sphinx-theme>=0.11 -# TODO: Remove <6 here and in actions when pydata-sphinx-theme handles sphinx 6 -sphinx>=5.2,<6 +sphinx>=5.2 |