aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/py3-beautifulsoup4/APKBUILD9
-rw-r--r--community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch54
2 files changed, 60 insertions, 3 deletions
diff --git a/community/py3-beautifulsoup4/APKBUILD b/community/py3-beautifulsoup4/APKBUILD
index a4e6ddf6b6..7a3fecbbe8 100644
--- a/community/py3-beautifulsoup4/APKBUILD
+++ b/community/py3-beautifulsoup4/APKBUILD
@@ -10,7 +10,9 @@ arch="noarch"
license="MIT"
depends="python3 py3-soupsieve"
makedepends="py3-setuptools"
-source="https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-$pkgver.tar.gz"
+source="https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-$pkgver.tar.gz
+ fix-tests-with-syntax-error.patch
+ "
builddir="$srcdir/$_pkgname-$pkgver"
replaces="py-beautifulsoup4" # Backwards compatibility
@@ -21,7 +23,7 @@ mips*) options="!check" ;;
esac
build() {
- 2to3 -w bs4
+ 2to3 -w --no-diff bs4
python3 setup.py build
}
@@ -33,4 +35,5 @@ package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
-sha512sums="aab90eb22614e9a2fb47792389a951b3ad7faf9791e15984a6c27a38be6f3d0ccbf3a9753d9afb5c70105097ac1a9c5f9e07206e12c6d4cb7a7f6d4e90ec18c2 beautifulsoup4-4.8.2.tar.gz"
+sha512sums="aab90eb22614e9a2fb47792389a951b3ad7faf9791e15984a6c27a38be6f3d0ccbf3a9753d9afb5c70105097ac1a9c5f9e07206e12c6d4cb7a7f6d4e90ec18c2 beautifulsoup4-4.8.2.tar.gz
+a5274b512daf2a7297073553a054a49bb4d1a2f96137cdde108ce2235e74a8c0d0418bb6597088519972864336d1ed2a63a8dada73b53a50bdc7f72b762fe19d fix-tests-with-syntax-error.patch"
diff --git a/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch b/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch
new file mode 100644
index 0000000000..06f7fd2ee3
--- /dev/null
+++ b/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch
@@ -0,0 +1,54 @@
+Upstream: yes
+Reason: soupsieve changed the exception they raised, so tests need to be
+updated to reflect that.
+diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
+index e69afdf..e387e8f 100644
+--- a/bs4/tests/test_tree.py
++++ b/bs4/tests/test_tree.py
+@@ -35,6 +35,8 @@ from bs4.testing import (
+ skipIf,
+ )
+
++from soupsieve.util import SelectorSyntaxError
++
+ XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None)
+ LXML_PRESENT = (builder_registry.lookup("lxml") is not None)
+
+@@ -1949,7 +1951,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'])
+@@ -2140,7 +2142,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
+@@ -2196,7 +2198,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'])
+@@ -2227,8 +2229,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'])