From fa95f5013668008182bb98fbe53282de31150b68d51fedbe24c82789f5a907c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sun, 12 Apr 2020 08:32:03 +0000 Subject: [PATCH] - Add patch to fix the tests to pass with new soupsieve too: * soupsieve2-tests.patch * The assert name changed - Update to 4.9.0: * fixes to work with new soupsieve OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-beautifulsoup4?expand=0&rev=75 --- beautifulsoup4-4.8.2.tar.gz | 3 --- beautifulsoup4-4.9.0.tar.gz | 3 +++ python-beautifulsoup4.changes | 13 +++++++++ python-beautifulsoup4.spec | 10 ++++--- soupsieve2-tests.patch | 50 +++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 7 deletions(-) delete mode 100644 beautifulsoup4-4.8.2.tar.gz create mode 100644 beautifulsoup4-4.9.0.tar.gz create mode 100644 soupsieve2-tests.patch diff --git a/beautifulsoup4-4.8.2.tar.gz b/beautifulsoup4-4.8.2.tar.gz deleted file mode 100644 index 7959d1d..0000000 --- a/beautifulsoup4-4.8.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:05fd825eb01c290877657a56df4c6e4c311b3965bda790c613a3d6fb01a5462a -size 298650 diff --git a/beautifulsoup4-4.9.0.tar.gz b/beautifulsoup4-4.9.0.tar.gz new file mode 100644 index 0000000..241daf8 --- /dev/null +++ b/beautifulsoup4-4.9.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:594ca51a10d2b3443cbac41214e12dbb2a1cd57e1a7344659849e2e20ba6a8d8 +size 368809 diff --git a/python-beautifulsoup4.changes b/python-beautifulsoup4.changes index d4f89d0..56b1109 100644 --- a/python-beautifulsoup4.changes +++ b/python-beautifulsoup4.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Apr 12 08:31:00 UTC 2020 - Tomáš Chvátal + +- Add patch to fix the tests to pass with new soupsieve too: + * soupsieve2-tests.patch + * The assert name changed + +------------------------------------------------------------------- +Sun Apr 12 07:50:37 UTC 2020 - Tomáš Chvátal + +- Update to 4.9.0: + * fixes to work with new soupsieve + ------------------------------------------------------------------- Wed Jan 1 08:52:41 UTC 2020 - Ismail Dönmez diff --git a/python-beautifulsoup4.spec b/python-beautifulsoup4.spec index 9a47015..f249628 100644 --- a/python-beautifulsoup4.spec +++ b/python-beautifulsoup4.spec @@ -18,20 +18,21 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-beautifulsoup4 -Version: 4.8.2 +Version: 4.9.0 Release: 0 Summary: HTML/XML Parser for Quick-Turnaround Applications Like Screen-Scraping License: MIT URL: https://www.crummy.com/software/BeautifulSoup/ Source: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz +Patch0: soupsieve2-tests.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module soupsieve} +BuildRequires: %{python_module soupsieve >= 1.2} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx -Requires: python-soupsieve -Suggests: python-html5lib >= 0.999999 +Requires: python-soupsieve >= 1.2 +Suggests: python-html5lib Suggests: python-lxml >= 3.4.4 BuildArch: noarch %python_subpackages @@ -74,6 +75,7 @@ Documentation and help files for %{name} %prep %setup -q -n beautifulsoup4-%{version} +%patch0 -p1 %build %python_build diff --git a/soupsieve2-tests.patch b/soupsieve2-tests.patch new file mode 100644 index 0000000..cccce03 --- /dev/null +++ b/soupsieve2-tests.patch @@ -0,0 +1,50 @@ +Index: beautifulsoup4-4.9.0/bs4/tests/test_tree.py +=================================================================== +--- beautifulsoup4-4.9.0.orig/bs4/tests/test_tree.py ++++ beautifulsoup4-4.9.0/bs4/tests/test_tree.py +@@ -37,6 +37,7 @@ from bs4.testing import ( + SoupTest, + skipIf, + ) ++from soupsieve import SelectorSyntaxError + + XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None) + LXML_PRESENT = (builder_registry.lookup("lxml") is not None) +@@ -2018,7 +2019,7 @@ class TestSoupSelector(TreeTest): + self.assertEqual(len(self.soup.select('del')), 0) + + def test_invalid_tag(self): +- self.assertRaises(SyntaxError, self.soup.select, 'tag%t') ++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'tag%t') + + def test_select_dashed_tag_ids(self): + self.assertSelects('custom-dashed-tag', ['dash1', 'dash2']) +@@ -2209,7 +2210,7 @@ class TestSoupSelector(TreeTest): + NotImplementedError, self.soup.select, "a:no-such-pseudoclass") + + self.assertRaises( +- SyntaxError, self.soup.select, "a:nth-of-type(a)") ++ SelectorSyntaxError, self.soup.select, "a:nth-of-type(a)") + + def test_nth_of_type(self): + # Try to select first paragraph +@@ -2265,7 +2266,7 @@ class TestSoupSelector(TreeTest): + self.assertEqual([], self.soup.select('#inner ~ h2')) + + def test_dangling_combinator(self): +- self.assertRaises(SyntaxError, self.soup.select, 'h1 >') ++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'h1 >') + + def test_sibling_combinator_wont_select_same_tag_twice(self): + self.assertSelects('p[lang] ~ p', ['lang-en-gb', 'lang-en-us', 'lang-fr']) +@@ -2296,8 +2297,8 @@ class TestSoupSelector(TreeTest): + self.assertSelects('div x,y, z', ['xid', 'yid', 'zida', 'zidb', 'zidab', 'zidac']) + + def test_invalid_multiple_select(self): +- self.assertRaises(SyntaxError, self.soup.select, ',x, y') +- self.assertRaises(SyntaxError, self.soup.select, 'x,,y') ++ self.assertRaises(SelectorSyntaxError, self.soup.select, ',x, y') ++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'x,,y') + + def test_multiple_select_attrs(self): + self.assertSelects('p[lang=en], p[lang=en-gb]', ['lang-en', 'lang-en-gb'])