From 185fa19bbf68a4d4dca534d2b46729207a177f16 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 11 May 2021 19:55:43 +0100 Subject: gentoo resync : 11.05.2021 --- dev-python/html5lib/Manifest | 3 +- .../html5lib/files/html5lib-1.1-pytest6.patch | 153 +++++++++++++++++++++ dev-python/html5lib/html5lib-1.1.ebuild | 9 +- 3 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 dev-python/html5lib/files/html5lib-1.1-pytest6.patch (limited to 'dev-python/html5lib') diff --git a/dev-python/html5lib/Manifest b/dev-python/html5lib/Manifest index 32403df8e342..dfe2ec19c886 100644 --- a/dev-python/html5lib/Manifest +++ b/dev-python/html5lib/Manifest @@ -1,3 +1,4 @@ +AUX html5lib-1.1-pytest6.patch 7489 BLAKE2B 73117fe1e75647760d8ccaa7296b8726d88dc11252d1dd23f3dc60ce28d7fc86dd724b6ee1e6756f937eb78ea7f684a1be9ab0783621971d252fb1f4b8fbae75 SHA512 d1a8642381bafb00f7b682ae35a01168731893e44ae3509ac36d3bc1d65ea48e32099447de9c09113da4ba1d0b6f969260c199c056f145295caf1bf985dc8a54 DIST html5lib-1.1.tar.gz 272215 BLAKE2B 11a4fc3fb84bf8bab4af5da1de30b0892a9eb454505716b3db391187053c9aac159b1c82ae787896592b8fc850363bba9313b9d7fc617150771c3bfa1aeadefb SHA512 af7c29591007fded99be6c38e3d0ae5a4ac32d71d26046a615918ae732cb1c1ecbf754f47ceca1a53726c3843f3ecea7af87a7362281b45ff3af495815818626 -EBUILD html5lib-1.1.ebuild 801 BLAKE2B ff65464464817ba243421f8b82ee0c9b6a9dc6b024a167c350e6b6d3392d4e44ab46c4a0edbe42b8acc97aea47e21e95a26a20615610f061dfeeeef4edc95ec9 SHA512 e94e26d0d35c720ff6c01bf3627686abb616e36ce04af4ccb22e86132f351dc5448bf3e08953e5f3594cb15d63a34c90fe500aeba597c13f5e27d91974adb838 +EBUILD html5lib-1.1.ebuild 794 BLAKE2B c01514c4b88927b168e55727bbebf6efc09216801a6d7089c3218e798acd9897ec0799c28177a0f05a308e8b05a0b4d15cd15504c70a48375a0d321df1ef3abd SHA512 9818dfde1bd6108d6c2efd0ecf4b5d71dfd7730c597a2cc444f59f05b392b2d9c815c61339e2a4a4bca67b0bb47350f87dc069e18c7da73a3f0489ba0348417c MISC metadata.xml 614 BLAKE2B 09fb1e4c136770b5e53aecf3af9681c9155bad58e2720e6e1af9aa8d5b44c184a48bbe0d204f8af0d3e61ddf9d3b60f19ae0034d6e66b4f8683fdf7e8ecd919f SHA512 1cd9bdc5fbbedc67023c31d24901c873a9d644b8dc4f26bb5b19eda8f0fe25c413b9bf0e2b52f7e73517d744d5757881cd26bd939c39eea748dd2f84c25d983b diff --git a/dev-python/html5lib/files/html5lib-1.1-pytest6.patch b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch new file mode 100644 index 000000000000..a511b40abeaa --- /dev/null +++ b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch @@ -0,0 +1,153 @@ +# 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(-) + +diff --git a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py +index dad167c5..fffeb50c 100644 +--- a/html5lib/tests/conftest.py ++++ b/html5lib/tests/conftest.py +@@ -99,10 +99,19 @@ def pytest_collect_file(path, parent): + + if _tree_construction in dir_and_parents: + if path.ext == ".dat": +- return TreeConstructionFile(path, parent) ++ return TreeConstructionFile.from_parent(parent, fspath=path) + elif _tokenizer in dir_and_parents: + if path.ext == ".test": +- return TokenizerFile(path, parent) ++ return TokenizerFile.from_parent(parent, fspath=path) + elif _sanitizer_testdata in dir_and_parents: + if path.ext == ".dat": +- return SanitizerFile(path, parent) ++ return SanitizerFile.from_parent(parent, fspath=path) ++ ++ ++# Tiny wrapper to allow .from_parent constructors on older pytest for PY27 ++if not hasattr(pytest.Item.__base__, "from_parent"): ++ @classmethod ++ def from_parent(cls, parent, **kwargs): ++ return cls(parent=parent, **kwargs) ++ ++ pytest.Item.__base__.from_parent = from_parent +diff --git a/html5lib/tests/sanitizer.py b/html5lib/tests/sanitizer.py +index bb483421..16e53868 100644 +--- a/html5lib/tests/sanitizer.py ++++ b/html5lib/tests/sanitizer.py +@@ -13,7 +13,7 @@ def collect(self): + with codecs.open(str(self.fspath), "r", encoding="utf-8") as fp: + tests = json.load(fp) + for i, test in enumerate(tests): +- yield SanitizerTest(str(i), self, test=test) ++ yield SanitizerTest.from_parent(self, name=str(i), test=test) + + + class SanitizerTest(pytest.Item): +diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +index 47264cc3..cc9897a4 100644 +--- a/html5lib/tests/tokenizer.py ++++ b/html5lib/tests/tokenizer.py +@@ -192,7 +192,7 @@ def collect(self): + tests = json.load(fp) + if 'tests' in tests: + for i, test in enumerate(tests['tests']): +- yield TokenizerTestCollector(str(i), self, testdata=test) ++ yield TokenizerTestCollector.from_parent(self, name=str(i), testdata=test) + + + class TokenizerTestCollector(pytest.Collector): +@@ -207,10 +207,10 @@ def __init__(self, name, parent=None, config=None, session=None, testdata=None): + def collect(self): + for initialState in self.testdata["initialStates"]: + initialState = capitalize(initialState) +- item = TokenizerTest(initialState, +- self, +- self.testdata, +- initialState) ++ item = TokenizerTest.from_parent(self, ++ name=initialState, ++ test=self.testdata, ++ initialState=initialState) + if self.testdata["input"] is None: + item.add_marker(pytest.mark.skipif(True, reason="Relies on lone surrogates")) + yield item +diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py +index 1ef6e725..fb0657bf 100644 +--- a/html5lib/tests/tree_construction.py ++++ b/html5lib/tests/tree_construction.py +@@ -26,7 +26,7 @@ class TreeConstructionFile(pytest.File): + def collect(self): + tests = TestData(str(self.fspath), "data") + for i, test in enumerate(tests): +- yield TreeConstructionTest(str(i), self, testdata=test) ++ yield TreeConstructionTest.from_parent(self, name=str(i), testdata=test) + + + class TreeConstructionTest(pytest.Collector): +@@ -48,11 +48,11 @@ def _getParserTests(self, treeName, treeAPIs): + nodeid = "%s::parser::namespaced" % treeName + else: + nodeid = "%s::parser::void-namespace" % treeName +- item = ParserTest(nodeid, +- self, +- self.testdata, +- treeAPIs["builder"] if treeAPIs is not None else None, +- namespaceHTMLElements) ++ item = ParserTest.from_parent(self, ++ name=nodeid, ++ test=self.testdata, ++ treeClass=treeAPIs["builder"] if treeAPIs is not None else None, ++ namespaceHTMLElements=namespaceHTMLElements) + item.add_marker(getattr(pytest.mark, treeName)) + item.add_marker(pytest.mark.parser) + if namespaceHTMLElements: +@@ -61,10 +61,10 @@ def _getParserTests(self, treeName, treeAPIs): + + def _getTreeWalkerTests(self, treeName, treeAPIs): + nodeid = "%s::treewalker" % treeName +- item = TreeWalkerTest(nodeid, +- self, +- self.testdata, +- treeAPIs) ++ item = TreeWalkerTest.from_parent(self, ++ name=nodeid, ++ test=self.testdata, ++ treeAPIs=treeAPIs) + item.add_marker(getattr(pytest.mark, treeName)) + item.add_marker(pytest.mark.treewalker) + yield item + diff --git a/dev-python/html5lib/html5lib-1.1.ebuild b/dev-python/html5lib/html5lib-1.1.ebuild index 3dc621cb73c5..3fddc1546717 100644 --- a/dev-python/html5lib/html5lib-1.1.ebuild +++ b/dev-python/html5lib/html5lib-1.1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7,8,9} pypy3 ) +PYTHON_COMPAT=( python3_{7..10} pypy3 ) PYTHON_REQ_USE="xml(+)" inherit distutils-r1 @@ -15,14 +15,15 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" LICENSE="MIT" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos" -IUSE="test" -RESTRICT+=" !test? ( test )" + +PATCHES=( + "${FILESDIR}"/${P}-pytest6.patch +) RDEPEND=">=dev-python/six-1.9[${PYTHON_USEDEP}] dev-python/webencodings[${PYTHON_USEDEP}]" BDEPEND=" test? ( - ${RDEPEND} dev-python/pytest-expect[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] )" -- cgit v1.2.3