From db9e47628805a7e03bd49bb49ddc3df964dcb57e Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:49:04 +0000 Subject: [PATCH] Increase the minimum supported version of Alabaster to 0.7.14 (#11858) --- pyproject.toml | 2 +- sphinx/builders/html/__init__.py | 18 ++---------------- tests/test_theming.py | 9 +-------- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 699ee0136..ae671bb54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ dependencies = [ "docutils>=0.18.1,<0.21", "snowballstemmer>=2.0", "babel>=2.9", - "alabaster>=0.7,<0.8", + "alabaster~=0.7.14", "imagesize>=1.3", "requests>=2.25.0", "packaging>=21.0", diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 4b592efef..0f3cccb34 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -961,22 +961,8 @@ class StandaloneHTMLBuilder(Builder): customsidebar = None # default sidebars settings for selected theme - if self.theme.name == 'alabaster': - # provide default settings for alabaster (for compatibility) - # Note: this will be removed before Sphinx-2.0 - try: - # get default sidebars settings from alabaster (if defined) - theme_default_sidebars = self.theme.config.get('theme', 'sidebars') - if theme_default_sidebars: - sidebars = [name.strip() for name in theme_default_sidebars.split(',')] - except Exception: - # fallback to better default settings - sidebars = ['about.html', 'navigation.html', 'relations.html', - 'searchbox.html', 'donate.html'] - else: - theme_default_sidebars = self.theme.get_config('theme', 'sidebars', None) - if theme_default_sidebars: - sidebars = [name.strip() for name in theme_default_sidebars.split(',')] + if theme_default_sidebars := self.theme.get_config('theme', 'sidebars', None): + sidebars = [name.strip() for name in theme_default_sidebars.split(',')] # user sidebar settings html_sidebars = self.get_builder_config('sidebars', 'html') diff --git a/tests/test_theming.py b/tests/test_theming.py index 2dfdd8dee..0544c710c 100644 --- a/tests/test_theming.py +++ b/tests/test_theming.py @@ -2,7 +2,6 @@ import os -import alabaster import pytest import sphinx.builders.html @@ -18,13 +17,7 @@ def test_theme_api(app, status, warning): themes = ['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku', 'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav', - 'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child'] - try: - alabaster_version = alabaster.__version_info__ - except AttributeError: - alabaster_version = alabaster.version.__version_info__ - if alabaster_version >= (0, 7, 11): - themes.append('alabaster') + 'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child', 'alabaster'] # test Theme class API assert set(app.registry.html_themes.keys()) == set(themes)