15
0

Accepting request 1220019 from devel:languages:python

- Add soupsieve26-compat.patch to make tests more tolerant with
  various versions of soupsieve (better solution for lp#2086199).
- Skip the test test_unsupported_pseudoclass (lp#2086199).

OBS-URL: https://build.opensuse.org/request/show/1220019
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-beautifulsoup4?expand=0&rev=41
This commit is contained in:
2024-11-06 15:49:29 +00:00
committed by Git OBS Bridge
3 changed files with 32 additions and 1 deletions

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Nov 1 07:22:57 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- 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 <mcepl@cepl.eu>
- Skip the test test_unsupported_pseudoclass (lp#2086199).
-------------------------------------------------------------------
Sat Jan 20 13:11:41 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -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

16
soupsieve26-compat.patch Normal file
View File

@@ -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):