Fix for Sphinx 4.1+, backported from upstream
This commit is contained in:
parent
e3e676fd8a
commit
a57fd0b745
40
2ab605a455.patch
Normal file
40
2ab605a455.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From 2ab605a455960523bf56bb305e254db3ebc5d00c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Carlisle <carlisle.b3d@gmail.com>
|
||||||
|
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
|
||||||
|
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 0.5.2
|
Version: 0.5.2
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: Sphinx theme for readthedocs.org
|
Summary: Sphinx theme for readthedocs.org
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -20,6 +20,9 @@ Patch0: %{name}-html5shiv.patch
|
|||||||
# Unbundle fonts. Refer to local fonts instead.
|
# Unbundle fonts. Refer to local fonts instead.
|
||||||
Patch1: %{name}-unbundle-fonts.patch
|
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
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: font(fontawesome)
|
BuildRequires: font(fontawesome)
|
||||||
@ -139,6 +142,9 @@ rm -fr %{buildroot}%{python3_sitelib}/%{srcname}/static/css/fonts
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 04 2021 Miro Hrončok <mhroncok@redhat.com> - 0.5.2-5
|
||||||
|
- Fix for Sphinx 4.1+
|
||||||
|
|
||||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user