Merge ~ahasenack/ubuntu/+source/soupsieve:eoan-soupsieve-fix-lxml4.4.0+-tests into ~ahasenack/ubuntu/+source/soupsieve:master

Proposed by Andreas Hasenack
Status: Merged
Approved by: Andreas Hasenack
Approved revision: d57d28c4e56a88c3d6fb8072e17e2a8346f1ef48
Merged at revision: d57d28c4e56a88c3d6fb8072e17e2a8346f1ef48
Proposed branch: ~ahasenack/ubuntu/+source/soupsieve:eoan-soupsieve-fix-lxml4.4.0+-tests
Merge into: ~ahasenack/ubuntu/+source/soupsieve:master
Diff against target: 84 lines (+52/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/fix-test_defined_xhtml-with-newer-lxml.patch (+41/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Robie Basak (community) Approve
Canonical Server Pending
Review via email: mp+372071@code.launchpad.net

Description of the change

This package is not yet imported into git-ubuntu, so I'm doing this MP against my own master branch.

Grabbed the fix from upstream to fix the DEP8 test failures when run with lxml 4.4.1 from eoan-proposed. Upstream's 1.9.3 (which is in debian) has the fix, but the changelog (and diff) tells me there are changes would require a feature freeze exception. In particular, the dropping of an undocumented feature ("quirks"):

https://github.com/facelessuser/soupsieve/compare/1.9.2...1.9.3

Since I'm not familiar with this package, and was able to get the exact fix needed from an upstream commit, I think it's best to not update the version at this time.

Local dep8 run with eoan-proposed enabled:

$ grep lxml.*4.4.* dep8-with-patch/log |head -n 1
Get:93 http://archive.ubuntu.com/ubuntu eoan-proposed/universe amd64 python-lxml amd64 4.4.1-1 [946 kB]

$ tail dep8-with-patch/log
    for el in sv.select('> span, > #pre', el, flags=sv.DEBUG | sv._QUIRKS):

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============== 658 passed, 4 skipped, 11 warnings in 4.43 seconds ==============
autopkgtest [11:21:40]: test unittests3: -----------------------]
autopkgtest [11:21:40]: test unittests3: - - - - - - - - - - results - - - - - - - - - -
unittests3 PASS
autopkgtest [11:21:40]: @@@@@@@@@@@@@@@@@@@@ summary
unittests PASS
unittests3 PASS

Without the patch I get the same failure that is occurring in britney right now.

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

+1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploading d57d28c4e56a88c3d6fb8072e17e2a8346f1ef48 from this branch. No upload tag since the package isn't imported.

$ dput ubuntu soupsieve_1.9.2+dfsg-2ubuntu1_source.changes
Checking signature on .changes
gpg: /home/ubuntu/soupsieve_1.9.2+dfsg-2ubuntu1_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: /home/ubuntu/soupsieve_1.9.2+dfsg-2ubuntu1.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading soupsieve_1.9.2+dfsg-2ubuntu1.dsc: done.
  Uploading soupsieve_1.9.2+dfsg-2ubuntu1.debian.tar.xz: done.
  Uploading soupsieve_1.9.2+dfsg-2ubuntu1_source.buildinfo: done.
  Uploading soupsieve_1.9.2+dfsg-2ubuntu1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index d00edde..a9366e7 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+soupsieve (1.9.2+dfsg-2ubuntu1) eoan; urgency=medium
7+
8+ * d/p/fix-test_defined_xhtml-with-newer-lxml.patch: fix
9+ test_defined_xhtml with lxml 4.4.0+. Thanks to Isaac Muse
10+ <faceless.shop@gmail.com>. (LP: #1842076)
11+
12+ -- Andreas Hasenack <andreas@canonical.com> Fri, 30 Aug 2019 11:06:20 -0300
13+
14 soupsieve (1.9.2+dfsg-2) unstable; urgency=medium
15
16 * Drop pypy binary package, Debian is pruning python 2 modules, where
17diff --git a/debian/control b/debian/control
18index ddd1b8d..31e4ce0 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: soupsieve
23 Section: python
24 Priority: optional
25-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
28 Uploaders: Stefano Rivera <stefanor@debian.org>
29 Build-Depends:
30 debhelper-compat (= 12),
31diff --git a/debian/patches/fix-test_defined_xhtml-with-newer-lxml.patch b/debian/patches/fix-test_defined_xhtml-with-newer-lxml.patch
32new file mode 100644
33index 0000000..7e5465e
34--- /dev/null
35+++ b/debian/patches/fix-test_defined_xhtml-with-newer-lxml.patch
36@@ -0,0 +1,41 @@
37+Description: fix test_defined_xhtml with lxml 4.4.0+
38+ Ubuntu note: dropped the other changes in that commit, keeping only
39+ the fix for the test issue.
40+Origin: upstream, https://github.com/facelessuser/soupsieve/commit/b9fddc053f7d5d7589245ba8e92cf7df639bf260
41+Author: Isaac Muse <faceless.shop@gmail.com>
42+Bug: https://github.com/facelessuser/soupsieve/pull/152
43+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/soupsieve/+bug/1842076
44+Last-Update: 2019-08-30
45+diff --git a/tests/test_level4/test_defined.py b/tests/test_level4/test_defined.py
46+index 12b992a..4a5568d 100644
47+--- a/tests/test_level4/test_defined.py
48++++ b/tests/test_level4/test_defined.py
49+@@ -45,21 +46,23 @@ class TestDefined(util.TestCase):
50+ <div-custom id="1"></div-custom>
51+ <prefix:div id="2"></prefix:div>
52+ <!--
53+- lxml or BeautifulSoup seems to strip away the prefix.
54+- This is most likely because prefix with no namespace is not really valid.
55++ lxml seems to strip away the prefix in versions less than 4.4.0.
56++ This was most likely because prefix with no namespace is not really valid.
57+ XML does allow colons in names, but encourages them to be used for namespaces.
58+- Do we really care that the prefix is wiped out in XHTML if there is no namespace?
59+- If we do, we should look into this in the future.
60++ This is a quirk of LXML, but it appears to be fine in 4.4.0+.
61+ -->
62+ <prefix:div-custom id="3"></prefix:div-custom>
63+ </body>
64+ </html>
65+ """
66+
67++ from lxml import etree
68++
69+ self.assert_selector(
70+ markup,
71+ 'body :defined',
72+- ['0', '2'], # We should get 3, but we don't for reasons stated above.
73++ # We should get 3, but for LXML versions less than 4.4.0 we don't for reasons stated above.
74++ ['0', '2'] if etree.LXML_VERSION < (4, 4, 0, 0) else ['0', '1', '2'],
75+ flags=util.XHTML
76+ )
77+
78diff --git a/debian/patches/series b/debian/patches/series
79new file mode 100644
80index 0000000..84c89ad
81--- /dev/null
82+++ b/debian/patches/series
83@@ -0,0 +1 @@
84+fix-test_defined_xhtml-with-newer-lxml.patch

Subscribers

People subscribed via source and target branches

to all changes: