diff --git a/python-beautifulsoup4.changes b/python-beautifulsoup4.changes index 1dce79b..6928094 100644 --- a/python-beautifulsoup4.changes +++ b/python-beautifulsoup4.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Nov 1 07:22:57 UTC 2024 - Matej Cepl + +- Add soupsieve26-compat.patch to make tests more tolerant with + various versions of soupsieve (better solution for lp#2086199). + +------------------------------------------------------------------- +Thu Oct 31 14:24:07 UTC 2024 - Matej Cepl + +- Skip the test test_unsupported_pseudoclass (lp#2086199). + ------------------------------------------------------------------- Sat Jan 20 13:11:41 UTC 2024 - Dirk Müller diff --git a/python-beautifulsoup4.spec b/python-beautifulsoup4.spec index dd9ed1f..6b2fa38 100644 --- a/python-beautifulsoup4.spec +++ b/python-beautifulsoup4.spec @@ -24,6 +24,9 @@ Summary: HTML/XML Parser for Quick-Turnaround Applications Like Screen-Sc License: MIT URL: https://www.crummy.com/software/BeautifulSoup/ Source: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz +# PATCH-FIX-UPSTREAM soupsieve26-compat.patch lp#2086199 mcepl@suse.com +# compatibility patch for various versions of soupsieve +Patch0: soupsieve26-compat.patch BuildRequires: %{python_module cchardet} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} @@ -37,6 +40,7 @@ Requires: python-cchardet Requires: python-soupsieve >= 1.2 Suggests: python-html5lib Suggests: python-lxml >= 3.4.4 +Provides: python-bs4 = %{version}-%{release} BuildArch: noarch %python_subpackages @@ -79,7 +83,7 @@ Documentation and help files for %{name} %endif %prep -%setup -q -n beautifulsoup4-%{version} +%autosetup -p1 -n beautifulsoup4-%{version} %build %pyproject_wheel diff --git a/soupsieve26-compat.patch b/soupsieve26-compat.patch new file mode 100644 index 0000000..2ae4c82 --- /dev/null +++ b/soupsieve26-compat.patch @@ -0,0 +1,16 @@ +--- + bs4/tests/test_css.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/bs4/tests/test_css.py ++++ b/bs4/tests/test_css.py +@@ -332,7 +332,8 @@ class TestCSSSelectors(SoupTest): + assert "yes" == chosen.string + + def test_unsupported_pseudoclass(self): +- with pytest.raises(NotImplementedError): ++ # Compatibility with various versions of soupsieve ++ with pytest.raises((NotImplementedError,SelectorSyntaxError)): + self.soup.select("a:no-such-pseudoclass") + + with pytest.raises(SelectorSyntaxError):