From dab866db4d1402be629eada5fede8184f12311a4 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 7 Jul 2022 15:29:16 +0200 Subject: [PATCH] Fix compatibility with Sphinx 5 --- 14.patch | 82 ++++++++++++++++++++++++++++++++ python-sphinxcontrib-qthelp.spec | 10 +++- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 14.patch diff --git a/14.patch b/14.patch new file mode 100644 index 0000000..f65375b --- /dev/null +++ b/14.patch @@ -0,0 +1,82 @@ +From 40f9dc8921486b7fd8ac84964f1e45103b540b81 Mon Sep 17 00:00:00 2001 +From: MeggyCal +Date: Wed, 1 Jun 2022 10:35:11 +0200 +Subject: [PATCH] Fix tests with Sphinx 5.0 + +--- + tests/test_qthelp.py | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/test_qthelp.py b/tests/test_qthelp.py +index fd83241..4c5f77d 100644 +--- a/tests/test_qthelp.py ++++ b/tests/test_qthelp.py +@@ -17,7 +17,7 @@ + def test_qthelp_basic(app, status, warning): + app.builder.build_all() + +- qhp = (app.outdir / 'Python.qhp').text() ++ qhp = (app.outdir / 'Python.qhp').read_text() + assert '' in qhp + assert 'Python' in qhp + assert '' in qhp +@@ -26,7 +26,7 @@ def test_qthelp_basic(app, status, warning): + assert 'index.html' in qhp + assert '_static/basic.css' in qhp + +- qhcp = (app.outdir / 'Python.qhcp').text() ++ qhcp = (app.outdir / 'Python.qhcp').read_text() + assert 'Python documentation' in qhcp + assert 'qthelp://org.sphinx.python/doc/index.html' in qhcp + assert 'qthelp://org.sphinx.python/doc/index.html' in qhcp +@@ -91,10 +91,10 @@ def test_qthelp_namespace(app, status, warning): + # default namespace + app.builder.build_all() + +- qhp = (app.outdir / 'Python.qhp').text() ++ qhp = (app.outdir / 'Python.qhp').read_text() + assert 'org.sphinx.python' in qhp + +- qhcp = (app.outdir / 'Python.qhcp').text() ++ qhcp = (app.outdir / 'Python.qhcp').read_text() + assert 'qthelp://org.sphinx.python/doc/index.html' in qhcp + assert 'qthelp://org.sphinx.python/doc/index.html' in qhcp + +@@ -102,10 +102,10 @@ def test_qthelp_namespace(app, status, warning): + app.config.qthelp_namespace = 'org.sphinx-doc.sphinx' + app.builder.build_all() + +- qhp = (app.outdir / 'Python.qhp').text() ++ qhp = (app.outdir / 'Python.qhp').read_text() + assert 'org.sphinx-doc.sphinx' in qhp + +- qhcp = (app.outdir / 'Python.qhcp').text() ++ qhcp = (app.outdir / 'Python.qhcp').read_text() + assert 'qthelp://org.sphinx-doc.sphinx/doc/index.html' in qhcp + assert 'qthelp://org.sphinx-doc.sphinx/doc/index.html' in qhcp + +@@ -115,10 +115,10 @@ def test_qthelp_title(app, status, warning): + # default title + app.builder.build_all() + +- qhp = (app.outdir / 'Python.qhp').text() ++ qhp = (app.outdir / 'Python.qhp').read_text() + assert '
' in qhp + +- qhcp = (app.outdir / 'Python.qhcp').text() ++ qhcp = (app.outdir / 'Python.qhcp').read_text() + assert 'Python documentation' in qhcp + + # give a title +@@ -126,9 +126,9 @@ def test_qthelp_title(app, status, warning): + app.config.html_short_title = 'Sphinx "short" title' + app.builder.build_all() + +- qhp = (app.outdir / 'Python.qhp').text() ++ qhp = (app.outdir / 'Python.qhp').read_text() + assert ('
' + in qhp) + +- qhcp = (app.outdir / 'Python.qhcp').text() ++ qhcp = (app.outdir / 'Python.qhcp').read_text() + assert 'Sphinx <b>"short"</b> title' in qhcp diff --git a/python-sphinxcontrib-qthelp.spec b/python-sphinxcontrib-qthelp.spec index 52563d1..e4fd726 100644 --- a/python-sphinxcontrib-qthelp.spec +++ b/python-sphinxcontrib-qthelp.spec @@ -5,13 +5,16 @@ Name: python-%{pypi_name} Version: 1.0.3 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Sphinx extension for QtHelp documents 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-qthelp/pull/14.patch + BuildRequires: gettext BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -34,7 +37,7 @@ sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document. %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} find -name '*.mo' -delete @@ -79,6 +82,9 @@ popd %changelog +* Thu Jul 07 2022 Karolina Surma - 1.0.3-10 +- Fix compatibility with Sphinx 5 + * Mon Jun 13 2022 Python Maint - 1.0.3-9 - Rebuilt for Python 3.11