From 92830197a0f7201cd23cd53c18e799cdf4547f1df4d4e5de766497e10333c25e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 31 Oct 2024 14:24:28 +0000 Subject: [PATCH 1/2] - Skip the test test_unsupported_pseudoclass (lp#2086199). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-beautifulsoup4?expand=0&rev=95 --- python-beautifulsoup4.changes | 5 +++++ python-beautifulsoup4.spec | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python-beautifulsoup4.changes b/python-beautifulsoup4.changes index 1dce79b..18f31b5 100644 --- a/python-beautifulsoup4.changes +++ b/python-beautifulsoup4.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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..9f50faa 100644 --- a/python-beautifulsoup4.spec +++ b/python-beautifulsoup4.spec @@ -37,6 +37,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 @@ -92,7 +93,8 @@ pushd doc && make html && rm build/html/.buildinfo build/html/objects.inv && po %check export LANG=en_US.UTF-8 export PYTHONDONTWRITEBYTECODE=1 -%pytest +# skip because of lp#2086199 +%pytest -k 'not test_unsupported_pseudoclass' %files %{python_files} %license LICENSE From 52207b5f156b77d2a17f58b7f080a3237ce2e886511c6b201210219d0d11fbf6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 1 Nov 2024 07:23:51 +0000 Subject: [PATCH 2/2] - Add soupsieve26-compat.patch to make tests more tolerant with various versions of soupsieve (better solution for lp#2086199). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-beautifulsoup4?expand=0&rev=96 --- python-beautifulsoup4.changes | 6 ++++++ python-beautifulsoup4.spec | 8 +++++--- soupsieve26-compat.patch | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 soupsieve26-compat.patch diff --git a/python-beautifulsoup4.changes b/python-beautifulsoup4.changes index 18f31b5..6928094 100644 --- a/python-beautifulsoup4.changes +++ b/python-beautifulsoup4.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/python-beautifulsoup4.spec b/python-beautifulsoup4.spec index 9f50faa..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} @@ -80,7 +83,7 @@ Documentation and help files for %{name} %endif %prep -%setup -q -n beautifulsoup4-%{version} +%autosetup -p1 -n beautifulsoup4-%{version} %build %pyproject_wheel @@ -93,8 +96,7 @@ pushd doc && make html && rm build/html/.buildinfo build/html/objects.inv && po %check export LANG=en_US.UTF-8 export PYTHONDONTWRITEBYTECODE=1 -# skip because of lp#2086199 -%pytest -k 'not test_unsupported_pseudoclass' +%pytest %files %{python_files} %license LICENSE 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):