Fix compatibility with Sphinx 5

This commit is contained in:
Karolina Surma 2022-07-07 10:17:18 +02:00
parent bfbcb050ac
commit f779865ef8
2 changed files with 39 additions and 2 deletions

31
16.patch Normal file
View File

@ -0,0 +1,31 @@
From 248ff52b3c3d39c20cdaef3052ac7507a407733a Mon Sep 17 00:00:00 2001
From: Takeshi KOMIYA <i.tkomiya@gmail.com>
Date: Sat, 17 Jul 2021 18:55:20 +0900
Subject: [PATCH] Fix #9457: RemovedInSphinx50Warning on testing
---
tests/test_htmlhelp.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test_htmlhelp.py b/tests/test_htmlhelp.py
index a74c66a..8774d4b 100644
--- a/tests/test_htmlhelp.py
+++ b/tests/test_htmlhelp.py
@@ -21,7 +21,7 @@
def test_build_htmlhelp(app, status, warning):
app.build()
- hhp = (app.outdir / 'pythondoc.hhp').text()
+ hhp = (app.outdir / 'pythondoc.hhp').read_text()
assert 'Compiled file=pythondoc.chm' in hhp
assert 'Contents file=pythondoc.hhc' in hhp
assert 'Default Window=pythondoc' in hhp
@@ -84,7 +84,7 @@ def assert_sitemap(node, name, filename):
assert node[1].attrib == {'name': 'Local', 'value': filename}
# .hhc file
- hhc = (app.outdir / 'pythondoc.hhc').text()
+ hhc = (app.outdir / 'pythondoc.hhc').read_text()
tree = HTMLParser(namespaceHTMLElements=False).parse(hhc)
items = tree.find('.//body/ul')
assert len(items) == 4

View File

@ -5,13 +5,16 @@
Name: python-%{pypi_name}
Version: 2.0.0
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Sphinx extension for HTML help files
License: BSD
URL: http://sphinx-doc.org/
Source0: %{pypi_source}
BuildArch: noarch
# In Sphinx 5 path.read_text() replaces path.text() - compatibility fix
Patch: https://github.com/sphinx-doc/sphinxcontrib-htmlhelp/pull/16.patch
BuildRequires: gettext
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
@ -35,7 +38,7 @@ sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files.
%prep
%autosetup -n %{pypi_name}-%{version}
%autosetup -p1 -n %{pypi_name}-%{version}
find -name '*.mo' -delete
@ -80,6 +83,9 @@ popd
%changelog
* Thu Jul 07 2022 Karolina Surma <ksurma@redhat.com> - 2.0.0-6
- Fix compatibility with Sphinx 5
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.0.0-5
- Rebuilt for Python 3.11