From a08663dbbc4d6eea96c398887babc9f62a22acf25476e68c4bc3d26f07625b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Tue, 19 Sep 2023 11:16:54 +0000 Subject: [PATCH] Accepting request 1112224 from home:mcalabkova:branches:devel:languages:python - Add sphinx71.patch and sphinx72.patch to fix tests with Sphinx 7.2 OBS-URL: https://build.opensuse.org/request/show/1112224 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-tabs?expand=0&rev=9 --- python-sphinx-tabs.changes | 5 + python-sphinx-tabs.spec | 8 +- sphinx71.patch | 188 +++++++++++++++++++++++++++ sphinx72.patch | 253 +++++++++++++++++++++++++++++++++++++ 4 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 sphinx71.patch create mode 100644 sphinx72.patch diff --git a/python-sphinx-tabs.changes b/python-sphinx-tabs.changes index 9ce2eaf..b195c6c 100644 --- a/python-sphinx-tabs.changes +++ b/python-sphinx-tabs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Sep 19 10:18:28 UTC 2023 - Markéta Machová + +- Add sphinx71.patch and sphinx72.patch to fix tests with Sphinx 7.2 + ------------------------------------------------------------------- Sun Jun 11 13:36:14 UTC 2023 - ecsos diff --git a/python-sphinx-tabs.spec b/python-sphinx-tabs.spec index b488c39..57a8d82 100644 --- a/python-sphinx-tabs.spec +++ b/python-sphinx-tabs.spec @@ -1,7 +1,7 @@ # # spec file for package python-sphinx-tabs # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -39,6 +39,10 @@ Group: Development/Languages/Python URL: https://github.com/executablebooks/sphinx-tabs # Use the github tag instead of the pythonhosted.org to get the tests folder Source: https://github.com/executablebooks/sphinx-tabs/archive/refs/tags/v%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/executablebooks/sphinx-tabs/commit/f60a10e13b3a6a8d1d27f285d9942b57ab07d0a8 Make the tests pass with Sphinx 7.1 +Patch: sphinx71.patch +# PATCH-FIX-UPSTREAM https://github.com/executablebooks/sphinx-tabs/pull/179 Fix tests for Sphinx 7.2 +Patch: sphinx72.patch BuildRequires: %{python_module Pygments} BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module docutils} @@ -60,7 +64,7 @@ BuildRequires: %{python_module sphinx-tabs = %{version}} Create tabbed content in Sphinx documentation when building HTML. %prep -%setup -q -n sphinx-tabs-%{version} +%autosetup -p1 -n sphinx-tabs-%{version} %build %python_build diff --git a/sphinx71.patch b/sphinx71.patch new file mode 100644 index 0000000..9b8972e --- /dev/null +++ b/sphinx71.patch @@ -0,0 +1,188 @@ +From f60a10e13b3a6a8d1d27f285d9942b57ab07d0a8 Mon Sep 17 00:00:00 2001 +From: Dmitry Shachnev +Date: Sun, 6 Aug 2023 15:24:52 +0300 +Subject: [PATCH] Make the tests pass with Sphinx 7.1 + +Update the expected XML files to match Sphinx 7.1 output, and patch +Sphinx < 7.1 output to match our new expectations. +--- + tests/conftest.py | 6 ++++++ + tests/test_build/test_basic.xml | 2 +- + .../test_conditional_assets_html_assets_policy_index_.xml | 2 +- + ...test_conditional_assets_html_assets_policy_no_tabs1_.xml | 2 +- + ...test_conditional_assets_html_assets_policy_no_tabs2_.xml | 2 +- + tests/test_build/test_conditional_assets_index_.xml | 2 +- + tests/test_build/test_conditional_assets_no_tabs1_.xml | 2 +- + tests/test_build/test_conditional_assets_no_tabs2_.xml | 2 +- + tests/test_build/test_custom_lexer.xml | 2 +- + tests/test_build/test_disable_closing.xml | 2 +- + tests/test_build/test_disable_css_loading.xml | 2 +- + tests/test_build/test_nested_markup.xml | 2 +- + tests/test_build/test_no_tabs.xml | 2 +- + tests/test_build/test_other_with_assets.xml | 2 +- + tests/test_build/test_rinohtype_pdf.xml | 2 +- + 15 files changed, 20 insertions(+), 14 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index b1f0728..f776f49 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -2,6 +2,7 @@ + import pytest + from pathlib import Path + from bs4 import BeautifulSoup ++import sphinx + from sphinx.testing.path import path + + from sphinx_tabs.tabs import FILES +@@ -123,6 +124,11 @@ def read(app, docname="index", resolve=False, regress=False, replace=None): + text = doctree.pformat() # type: str + for find, rep in (replace or {}).items(): + text = text.replace(find, rep) ++ if sphinx.version_info < (7, 1): ++ text = text.replace( ++ '', ++ "", ++ ) + file_regression.check(text, extension=extension) + + return doctree +diff --git a/tests/test_build/test_basic.xml b/tests/test_build/test_basic.xml +index f1f6d71..1ef24d7 100644 +--- a/tests/test_build/test_basic.xml ++++ b/tests/test_build/test_basic.xml +@@ -1,4 +1,4 @@ +- ++ + +
+