From a57fd0b74521dfaf1fbeaa81bac60caf3022224b Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Aug 04 2021 21:51:52 +0000 Subject: Fix for Sphinx 4.1+, backported from upstream --- diff --git a/2ab605a455.patch b/2ab605a455.patch new file mode 100644 index 0000000..9546fd2 --- /dev/null +++ b/2ab605a455.patch @@ -0,0 +1,40 @@ +From 2ab605a455960523bf56bb305e254db3ebc5d00c Mon Sep 17 00:00:00 2001 +From: Aaron Carlisle +Date: Tue, 13 Jul 2021 05:16:47 -0400 +Subject: [PATCH] Tests: Fix deprecation warning with new sphinx versions + (#1105) + +* Tests: Fix deprecation warning with new sphinx versions + +These builders where split in sphinx and the old import path will be removed in the upcoming Sphinx 4 release. + +This patch requires sphinx 2 so this will be committed into the v2 release. + +* Fix imports + +* Use try/except for backwards compatibility +--- + tests/test_builders.py | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/tests/test_builders.py b/tests/test_builders.py +index ce8fb3cc1..d3d3c51b7 100644 +--- a/tests/test_builders.py ++++ b/tests/test_builders.py +@@ -3,7 +3,15 @@ + import pytest + import sphinx + from sphinx import addnodes +-from sphinx.builders.html import SingleFileHTMLBuilder, DirectoryHTMLBuilder ++try: ++ # Available from Sphinx 2.0 ++ from sphinx.builders.dirhtml import DirectoryHTMLBuilder ++ from sphinx.builders.singlehtml import SingleFileHTMLBuilder ++except ImportError: ++ from sphinx.builders.html import ( ++ DirectoryHTMLBuilder, ++ SingleFileHTMLBuilder, ++ ) + + from .util import build_all + diff --git a/python-sphinx_rtd_theme.spec b/python-sphinx_rtd_theme.spec index e27b9a2..cd89ca6 100644 --- a/python-sphinx_rtd_theme.spec +++ b/python-sphinx_rtd_theme.spec @@ -5,7 +5,7 @@ Name: python-%{srcname} Version: 0.5.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Sphinx theme for readthedocs.org License: MIT @@ -20,6 +20,9 @@ Patch0: %{name}-html5shiv.patch # Unbundle fonts. Refer to local fonts instead. Patch1: %{name}-unbundle-fonts.patch +# Fix for Sphinx 4.1+, backported from upstream +Patch2: https://github.com/readthedocs/sphinx_rtd_theme/commit/2ab605a455.patch + BuildArch: noarch BuildRequires: font(fontawesome) @@ -139,6 +142,9 @@ rm -fr %{buildroot}%{python3_sitelib}/%{srcname}/static/css/fonts %endif %changelog +* Wed Aug 04 2021 Miro Hrončok - 0.5.2-5 +- Fix for Sphinx 4.1+ + * Fri Jul 23 2021 Fedora Release Engineering - 0.5.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild