[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/files/, dev-python/html5lib/
commit: bf771b119c73f49614f9d1aedf1cc5480b79c303 Author: Michał Górny gentoo org> AuthorDate: Wed Jan 24 16:47:14 2024 + Commit: Michał Górny gentoo org> CommitDate: Wed Jan 24 16:51:31 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf771b11 dev-python/html5lib: Backport pytest-7.4 fix Closes: https://bugs.gentoo.org/910475 Signed-off-by: Michał Górny gentoo.org> .../html5lib/files/html5lib-1.1-pytest6.patch | 66 ++ dev-python/html5lib/html5lib-1.1-r1.ebuild | 7 ++- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/dev-python/html5lib/files/html5lib-1.1-pytest6.patch b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch index a511b40abeaa..d8df5f2cf2f6 100644 --- a/dev-python/html5lib/files/html5lib-1.1-pytest6.patch +++ b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch @@ -1,41 +1,7 @@ # https://github.com/html5lib/html5lib-python/pull/506 # https://bugs.gentoo.org/754144 -From e6bd99e8f2497194ffd0a06c6954ebb28d7526bb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Sat, 8 Aug 2020 13:39:22 +0200 -Subject: [PATCH] Use Node.from_parent() constructor to support pytest 6 -Add a wrapper not to break pytest 4 (needed for Python 2 support). - -= test session starts == -platform linux -- Python 3.9.0b5, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -rootdir: /builddir/build/BUILD/html5lib-1.1, configfile: pytest.ini -plugins: expect-1.1.0 -collected 0 items / 1 error - - ERRORS - ERROR collecting test session _ -/usr/lib/python3.9/site-packages/pluggy/hooks.py:286: in __call__ -return self._hookexec(self, self.get_hookimpls(), kwargs) -/usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec -return self._inner_hookexec(hook, methods, kwargs) -/usr/lib/python3.9/site-packages/pluggy/manager.py:84: in -self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( -html5lib/tests/conftest.py:105: in pytest_collect_file -return TokenizerFile(path, parent) -/usr/lib/python3.9/site-packages/_pytest/nodes.py:95: in __call__ -warnings.warn(NODE_USE_FROM_PARENT.format(name=self.__name__), stacklevel=2) -E pytest.PytestDeprecationWarning: Direct construction of TokenizerFile has been deprecated, please use TokenizerFile.from_parent. -E See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details. - -Fixes https://github.com/html5lib/html5lib-python/issues/505 - html5lib/tests/conftest.py | 15 --- - html5lib/tests/sanitizer.py | 2 +- - html5lib/tests/tokenizer.py | 10 +- - html5lib/tests/tree_construction.py | 20 ++-- - requirements-test.txt | 2 +- - 5 files changed, 29 insertions(+), 20 deletions(-) +and part of 4a87368b71090f1432df6302f178c4babfcec93f diff --git a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py index dad167c5..fffeb50c 100644 @@ -151,3 +117,33 @@ index 1ef6e725..fb0657bf 100644 item.add_marker(pytest.mark.treewalker) yield item +diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +index cc9897a..b49d2e6 100644 +--- a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +@@ -246,7 +246,9 @@ class TokenizerTest(pytest.Item): + def repr_failure(self, excinfo): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=__file__) +-excinfo.traceback = ntraceback.filter() ++pytest_ver = getattr(pytest, "version_tuple", ()) ++filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () ++excinfo.traceback = ntraceback.filter(*filter_args) + + return excinfo.getrepr(funcargs=True, +showlocals=False, +diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py +index fb0657b..363b48c 100644 +--- a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py +@@ -135,7 +135,9 @@ class ParserTest(pytest.Item): + def repr_failure(self, excinfo): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=__file__) +-excinfo.traceback = ntraceback.filter() ++pytest_ver = getattr(pytest, "version_tuple", ()) ++filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else () ++excinfo.traceback = ntraceback.filter(*filter_args) + + return excinfo.getrepr(funcargs=True, +showlocals=False, diff --git a/dev-python/html5lib/html5lib-1.1-r1.ebuild b/dev-python/html5lib/html5lib-1.1-r1.ebuild index 7aaf19a606af..85d2d88a1104 100644 --- a/dev-python/html5lib/html5
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/files/
commit: ab9ade98f4508946e4f9dc0acab4ded74c2362c4 Author: Michał Górny gentoo org> AuthorDate: Sat Apr 4 19:00:13 2020 + Commit: Michał Górny gentoo org> CommitDate: Sat Apr 4 19:06:32 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab9ade98 dev-python/html5lib: Commit missing patch Signed-off-by: Michał Górny gentoo.org> .../files/html5lib-1.0.1-collections-abc.patch | 44 ++ 1 file changed, 44 insertions(+) diff --git a/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch b/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch new file mode 100644 index 000..d5a9dcac299 --- /dev/null +++ b/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch @@ -0,0 +1,44 @@ +From 4f9235752cea29c5a31721440578b430823a1e69 Mon Sep 17 00:00:00 2001 +From: 5j9 <5...@users.noreply.github.com> +Date: Mon, 1 Oct 2018 15:02:33 +0330 +Subject: [PATCH] Try to import MutableMapping from collections.abc (#403) + +Note that collections.abc has been added in Python 3.3. + +Fixes #402 +--- + html5lib/_trie/_base.py | 5 - + html5lib/treebuilders/dom.py | 5 - + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py +index a1158bbb..6b71975f 100644 +--- a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py +@@ -1,6 +1,9 @@ + from __future__ import absolute_import, division, unicode_literals + +-from collections import Mapping ++try: ++from collections.abc import Mapping ++except ImportError: # Python 2.7 ++from collections import Mapping + + + class Trie(Mapping): +diff --git a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py +index dcfac220..d8b53004 100644 +--- a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py +@@ -1,7 +1,10 @@ + from __future__ import absolute_import, division, unicode_literals + + +-from collections import MutableMapping ++try: ++from collections.abc import MutableMapping ++except ImportError: # Python 2.7 ++from collections import MutableMapping + from xml.dom import minidom, Node + import weakref +
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/files/
commit: ee2530ebfe919efebea96356a99d4a9958acdf18 Author: Zac Medico gentoo org> AuthorDate: Tue Mar 28 19:32:37 2017 + Commit: Zac Medico gentoo org> CommitDate: Tue Mar 28 19:33:31 2017 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee2530eb dev-python/html5lib: fix sanitizer patch to match upstream See: https://github.com/html5lib/html5lib-python/commit/17499b9763a090f7715af49555d21fe4b558958b Package-Manager: Portage-2.3.5, Repoman-2.3.2 .../html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch b/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch index c64cbe1ab3f..2fbef2ad0b9 100644 --- a/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch +++ b/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch @@ -5,7 +5,7 @@ if attr not in attrs: continue -val_unescaped = re.sub("[`\000-\040\177-\240\s]+", '', -+val_unescaped = re.sub(r"[`\000-\040\177-\240\s]+", '', ++val_unescaped = re.sub("[`\x00-\x20\x7f-\xa0\\s]+", '', unescape(attrs[attr])).lower() # remove replacement characters from unescaped characters val_unescaped = val_unescaped.replace("\ufffd", "")
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/files/, dev-python/html5lib/
commit: 57cb992a751b02459dbf70da77a0ffa0b07d22dc Author: Justin Lecher gentoo org> AuthorDate: Mon Jan 18 08:39:00 2016 + Commit: Justin Lecher gentoo org> CommitDate: Mon Jan 18 08:44:48 2016 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57cb992a dev-python/html5lib: Backport fix for lxml-3.5.0 Package-Manager: portage-2.2.26 Signed-off-by: Justin Lecher gentoo.org> .../html5lib-0.999-lxml-3.5.0-backport.patch | 117 + dev-python/html5lib/html5lib-0.999-r1.ebuild | 32 ++ 2 files changed, 149 insertions(+) diff --git a/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch b/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch new file mode 100644 index 000..fecfab9 --- /dev/null +++ b/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch @@ -0,0 +1,117 @@ +From 46046c0f7125911ff8205f09a7574573bb953105 Mon Sep 17 00:00:00 2001 +From: Geoffrey Sneddon +Date: Mon, 23 Nov 2015 15:17:07 + +Subject: [PATCH 1/3] Make lxml tree-builder coerce comments to work with lxml + 3.5. + +--- + html5lib/ihatexml.py| 2 ++ + html5lib/treebuilders/etree_lxml.py | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/html5lib/ihatexml.py b/html5lib/ihatexml.py +index 0fc7930..b5b2e98 100644 +--- a/html5lib/ihatexml.py b/html5lib/ihatexml.py +@@ -225,6 +225,8 @@ def coerceComment(self, data): + while "--" in data: + warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning) + data = data.replace("--", "- -") ++if data.endswith("-"): ++data += " " + return data + + def coerceCharacters(self, data): +diff --git a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py +index 35d08ef..17007e3 100644 +--- a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py +@@ -189,7 +189,7 @@ class TreeBuilder(_base.TreeBuilder): + + def __init__(self, namespaceHTMLElements, fullTree=False): + builder = etree_builders.getETreeModule(etree, fullTree=fullTree) +-infosetFilter = self.infosetFilter = ihatexml.InfosetFilter() ++infosetFilter = self.infosetFilter = ihatexml.InfosetFilter(preventDoubleDashComments=True) + self.namespaceHTMLElements = namespaceHTMLElements + + class Attributes(dict): + +From 1c22e1ce93dd4acc81a66cfa03cf9720fbd741c7 Mon Sep 17 00:00:00 2001 +From: Geoffrey Sneddon +Date: Mon, 23 Nov 2015 15:35:21 + +Subject: [PATCH 2/3] fixup! Make lxml tree-builder coerce comments to work + with lxml 3.5. + +--- + html5lib/ihatexml.py| 1 + + html5lib/treebuilders/etree_lxml.py | 7 --- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/html5lib/ihatexml.py b/html5lib/ihatexml.py +index b5b2e98..5a81a12 100644 +--- a/html5lib/ihatexml.py b/html5lib/ihatexml.py +@@ -226,6 +226,7 @@ def coerceComment(self, data): + warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning) + data = data.replace("--", "- -") + if data.endswith("-"): ++warnings.warn("Comments cannot contain end in a dash", DataLossWarning) + data += " " + return data + +diff --git a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py +index 17007e3..c6c981f 100644 +--- a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py +@@ -54,7 +54,7 @@ def _getChildNodes(self): + def testSerializer(element): + rv = [] + finalText = None +-infosetFilter = ihatexml.InfosetFilter() ++infosetFilter = ihatexml.InfosetFilter(preventDoubleDashComments=True) + + def serializeElement(element, indent=0): + if not hasattr(element, "tag"): +@@ -257,7 +257,7 @@ def _getData(self): + data = property(_getData, _setData) + + self.elementClass = Element +-self.commentClass = builder.Comment ++self.commentClass = Comment + # self.fragmentClass = builder.DocumentFragment + _base.TreeBuilder.__init__(self, namespaceHTMLElements) + +@@ -344,7 +344,8 @@ def insertRoot(self, token): + + # Append the initial comments: + for comment_token in self.initial_comments: +-root.addprevious(etree.Comment(comment_token["data"])) ++comment = self.commentClass(comment_token["data"]) ++root.addprevious(comment._element) + + # Create the root document and add the ElementTree to it + self.document = self.documentClass() + +From 235a6d7ac7e0a3e2b431766e051094c2d3110ba3 Mon Sep 17 00:00:00 2001 +From: Geoffrey Sneddon +Date: Mon, 23 Nov 2015 15:42:12 + +Subject: [PATCH 3/3] fixup! Make lxml tree-builder coerce comments to work + with lxml 3.5. + +--- + html5lib/ihatexml.py | 2 +- + 1 file changed, 1 ins