Skip to content

Commit db9e476

Browse files
authored
Increase the minimum supported version of Alabaster to 0.7.14 (#11858)
1 parent a6b0dbc commit db9e476

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies = [
6767
"docutils>=0.18.1,<0.21",
6868
"snowballstemmer>=2.0",
6969
"babel>=2.9",
70-
"alabaster>=0.7,<0.8",
70+
"alabaster~=0.7.14",
7171
"imagesize>=1.3",
7272
"requests>=2.25.0",
7373
"packaging>=21.0",

sphinx/builders/html/__init__.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -961,22 +961,8 @@ def has_wildcard(pattern: str) -> bool:
961961
customsidebar = None
962962

963963
# default sidebars settings for selected theme
964-
if self.theme.name == 'alabaster':
965-
# provide default settings for alabaster (for compatibility)
966-
# Note: this will be removed before Sphinx-2.0
967-
try:
968-
# get default sidebars settings from alabaster (if defined)
969-
theme_default_sidebars = self.theme.config.get('theme', 'sidebars')
970-
if theme_default_sidebars:
971-
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
972-
except Exception:
973-
# fallback to better default settings
974-
sidebars = ['about.html', 'navigation.html', 'relations.html',
975-
'searchbox.html', 'donate.html']
976-
else:
977-
theme_default_sidebars = self.theme.get_config('theme', 'sidebars', None)
978-
if theme_default_sidebars:
979-
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
964+
if theme_default_sidebars := self.theme.get_config('theme', 'sidebars', None):
965+
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
980966

981967
# user sidebar settings
982968
html_sidebars = self.get_builder_config('sidebars', 'html')

tests/test_theming.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import os
44

5-
import alabaster
65
import pytest
76

87
import sphinx.builders.html
@@ -18,13 +17,7 @@ def test_theme_api(app, status, warning):
1817

1918
themes = ['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
2019
'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav',
21-
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child']
22-
try:
23-
alabaster_version = alabaster.__version_info__
24-
except AttributeError:
25-
alabaster_version = alabaster.version.__version_info__
26-
if alabaster_version >= (0, 7, 11):
27-
themes.append('alabaster')
20+
'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child', 'alabaster']
2821

2922
# test Theme class API
3023
assert set(app.registry.html_themes.keys()) == set(themes)

0 commit comments

Comments
 (0)