Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/soupsieve/files/, dev-python/soupsieve/
Date: Fri, 29 Oct 2021 15:12:34
Message-Id: 1635520319.a7c581c17cf5d123604e0eab833273b8792edc63.sam@gentoo
1 commit: a7c581c17cf5d123604e0eab833273b8792edc63
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 29 15:11:59 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 29 15:11:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7c581c1
7
8 dev-python/soupsieve: skip tests broken due to known lxml bug
9
10 Using Debian's patch.
11
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 .../files/soupsieve-2.2.1-lxml-libxml2-tests.patch | 64 ++++++++++++++++++++++
15 ...ieve-2.2.1.ebuild => soupsieve-2.2.1-r1.ebuild} | 9 ++-
16 2 files changed, 72 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch b/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch
19 new file mode 100644
20 index 00000000000..a7075fa6fb6
21 --- /dev/null
22 +++ b/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch
23 @@ -0,0 +1,64 @@
24 +https://sources.debian.org/data/main/s/soupsieve/2.2.1-2/debian/patches/libxml2-2.9.11
25 +https://github.com/facelessuser/soupsieve/issues/220
26 +
27 +Apply Debian patch to skip tests which expose a lxml bug that's
28 +already being handled elsewhere.
29 +
30 +From: Stefano Rivera <stefanor@××××××.org>
31 +Date: Sat, 2 Oct 2021 12:05:17 -0700
32 +Subject: Mark test_contains_cdata_html tests XFAIL for libxml2 >= 2.9.11
33 +
34 +libxml2 changed CDATA handling in 2.9.11.
35 +Beautifulsoup supports this change, but lxml upstream has pinned on an
36 +older version so the behaviour change isn't standardised upstream, yet.
37 +
38 +Bug-upstream: https://github.com/facelessuser/soupsieve/issues/220
39 +Bug-lxml: https://bugs.launchpad.net/lxml/+bug/1928795
40 +Bug-beautifulsoup: https://bugs.launchpad.net/beautifulsoup/+bug/1930164
41 +Bug-Debian: https://bugs.debian.org/995459
42 +
43 +Forwarded: no
44 +--- a/tests/test_extra/test_soup_contains.py
45 ++++ b/tests/test_extra/test_soup_contains.py
46 +@@ -3,6 +3,9 @@ from .. import util
47 + import warnings
48 + import soupsieve as sv
49 +
50 ++import pytest
51 ++from lxml.etree import LIBXML_VERSION
52 ++
53 +
54 + class TestSoupContains(util.TestCase):
55 + """Test soup-contains selectors."""
56 +@@ -144,6 +147,9 @@ class TestSoupContains(util.TestCase):
57 + flags=util.HTML
58 + )
59 +
60 ++ @pytest.mark.xfail(LIBXML_VERSION >= (2, 9, 11),
61 ++ reason='lxml parser changed CDATA handling, see '
62 ++ 'https://github.com/facelessuser/soupsieve/issues/220')
63 + def test_contains_cdata_html(self):
64 + """Test contains CDATA in HTML5."""
65 +
66 +--- a/tests/test_extra/test_soup_contains_own.py
67 ++++ b/tests/test_extra/test_soup_contains_own.py
68 +@@ -1,6 +1,9 @@
69 + """Test contains selectors."""
70 + from .. import util
71 +
72 ++import pytest
73 ++from lxml.etree import LIBXML_VERSION
74 ++
75 +
76 + class TestSoupContainsOwn(util.TestCase):
77 + """Test soup-contains-own selectors."""
78 +@@ -35,6 +38,9 @@ class TestSoupContainsOwn(util.TestCase):
79 + flags=util.HTML
80 + )
81 +
82 ++ @pytest.mark.xfail(LIBXML_VERSION >= (2, 9, 11),
83 ++ reason='lxml parser changed CDATA handling, see '
84 ++ 'https://github.com/facelessuser/soupsieve/issues/220')
85 + def test_contains_own_cdata_html(self):
86 + """Test contains CDATA in HTML5."""
87 +
88
89 diff --git a/dev-python/soupsieve/soupsieve-2.2.1.ebuild b/dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild
90 similarity index 73%
91 rename from dev-python/soupsieve/soupsieve-2.2.1.ebuild
92 rename to dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild
93 index c7f078edb7b..02ac9fda95f 100644
94 --- a/dev-python/soupsieve/soupsieve-2.2.1.ebuild
95 +++ b/dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild
96 @@ -19,9 +19,16 @@ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 s
97 BDEPEND="
98 test? (
99 dev-python/beautifulsoup4[${PYTHON_USEDEP}]
100 - <dev-python/lxml-4.6.3-r1[${PYTHON_USEDEP}]
101 + dev-python/lxml[${PYTHON_USEDEP}]
102 dev-python/html5lib[${PYTHON_USEDEP}]
103 )
104 "
105
106 +PATCHES=(
107 + # Needed for now until something is figured out either at lxml
108 + # upstream or libxml2?
109 + # See https://github.com/facelessuser/soupsieve/issues/220
110 + "${FILESDIR}"/${PN}-2.2.1-lxml-libxml2-tests.patch
111 +)
112 +
113 distutils_enable_tests pytest