Tue Apr 30 09:01:14 2024 UTC (37d)
py-html5lib: convert to wheel.mk.

Add upstream patches to get test suite to progress a bit further.

Bump PKGREVISION.


(wiz)
diff -r1.16 -r1.17 pkgsrc/textproc/py-html5lib/Makefile
diff -r1.9 -r1.10 pkgsrc/textproc/py-html5lib/PLIST
diff -r1.12 -r1.13 pkgsrc/textproc/py-html5lib/distinfo
diff -r0 -r1.1 pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_conftest.py
diff -r0 -r1.1 pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_sanitizer.py
diff -r0 -r1.1 pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_tokenizer.py
diff -r0 -r1.1 pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_tree__construction.py
diff -r0 -r1.1 pkgsrc/textproc/py-html5lib/patches/patch-requirements-test.txt

cvs diff -r1.16 -r1.17 pkgsrc/textproc/py-html5lib/Makefile (expand / switch to unified diff)

--- pkgsrc/textproc/py-html5lib/Makefile 2024/01/14 09:44:59 1.16
+++ pkgsrc/textproc/py-html5lib/Makefile 2024/04/30 09:01:14 1.17
@@ -1,26 +1,28 @@ @@ -1,26 +1,28 @@
1# $NetBSD: Makefile,v 1.16 2024/01/14 09:44:59 wiz Exp $ 1# $NetBSD: Makefile,v 1.17 2024/04/30 09:01:14 wiz Exp $
2 2
3DISTNAME= html5lib-1.1 3DISTNAME= html5lib-1.1
4PKGNAME= ${PYPKGPREFIX}-${DISTNAME} 4PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
5PKGREVISION= 1 5PKGREVISION= 2
6CATEGORIES= textproc www python 6CATEGORIES= textproc www python
7MASTER_SITES= ${MASTER_SITE_PYPI:=h/html5lib/} 7MASTER_SITES= ${MASTER_SITE_PYPI:=h/html5lib/}
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://github.com/html5lib/html5lib-python 10HOMEPAGE= https://github.com/html5lib/html5lib-python
11COMMENT= HTML5 parser and tokenizer 11COMMENT= HTML5 parser and tokenizer
12LICENSE= mit 12LICENSE= mit
13 13
 14TOOL_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:../../devel/py-setuptools
 15TOOL_DEPENDS+= ${PYPKGPREFIX}-wheel-[0-9]*:../../devel/py-wheel
14DEPENDS+= ${PYPKGPREFIX}-genshi-[0-9]*:../../www/py-genshi 16DEPENDS+= ${PYPKGPREFIX}-genshi-[0-9]*:../../www/py-genshi
 17DEPENDS+= ${PYPKGPREFIX}-lxml-[0-9]*:../../textproc/py-lxml
15DEPENDS+= ${PYPKGPREFIX}-six>=1.9:../../lang/py-six 18DEPENDS+= ${PYPKGPREFIX}-six>=1.9:../../lang/py-six
16DEPENDS+= ${PYPKGPREFIX}-webencodings-[0-9]*:../../textproc/py-webencodings 19DEPENDS+= ${PYPKGPREFIX}-webencodings-[0-9]*:../../textproc/py-webencodings
17TEST_DEPENDS+= ${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test 
18TEST_DEPENDS+= ${PYPKGPREFIX}-mock-[0-9]*:../../devel/py-mock 20TEST_DEPENDS+= ${PYPKGPREFIX}-mock-[0-9]*:../../devel/py-mock
 21TEST_DEPENDS+= ${PYPKGPREFIX}-test-expect-[0-9]*:../../devel/py-test-expect
19 22
20USE_LANGUAGES= # none 23USE_LANGUAGES= # none
21 24
22PYTHON_VERSIONED_DEPENDENCIES+= lxml 25PYTHON_VERSIONS_INCOMPATIBLE= 27
23 26
24.include "../../lang/python/egg.mk" 27.include "../../lang/python/wheel.mk"
25.include "../../lang/python/versioned_dependencies.mk" 
26.include "../../mk/bsd.pkg.mk" 28.include "../../mk/bsd.pkg.mk"

cvs diff -r1.9 -r1.10 pkgsrc/textproc/py-html5lib/PLIST (expand / switch to unified diff)

--- pkgsrc/textproc/py-html5lib/PLIST 2021/11/09 20:10:28 1.9
+++ pkgsrc/textproc/py-html5lib/PLIST 2024/04/30 09:01:14 1.10
@@ -1,19 +1,20 @@ @@ -1,19 +1,20 @@
1@comment $NetBSD: PLIST,v 1.9 2021/11/09 20:10:28 wiz Exp $ 1@comment $NetBSD: PLIST,v 1.10 2024/04/30 09:01:14 wiz Exp $
2${PYSITELIB}/${EGG_INFODIR}/PKG-INFO 2${PYSITELIB}/${WHEEL_INFODIR}/AUTHORS.rst
3${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt 3${PYSITELIB}/${WHEEL_INFODIR}/LICENSE
4${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt 4${PYSITELIB}/${WHEEL_INFODIR}/METADATA
5${PYSITELIB}/${EGG_INFODIR}/requires.txt 5${PYSITELIB}/${WHEEL_INFODIR}/RECORD
6${PYSITELIB}/${EGG_INFODIR}/top_level.txt 6${PYSITELIB}/${WHEEL_INFODIR}/WHEEL
 7${PYSITELIB}/${WHEEL_INFODIR}/top_level.txt
7${PYSITELIB}/html5lib/__init__.py 8${PYSITELIB}/html5lib/__init__.py
8${PYSITELIB}/html5lib/__init__.pyc 9${PYSITELIB}/html5lib/__init__.pyc
9${PYSITELIB}/html5lib/__init__.pyo 10${PYSITELIB}/html5lib/__init__.pyo
10${PYSITELIB}/html5lib/_ihatexml.py 11${PYSITELIB}/html5lib/_ihatexml.py
11${PYSITELIB}/html5lib/_ihatexml.pyc 12${PYSITELIB}/html5lib/_ihatexml.pyc
12${PYSITELIB}/html5lib/_ihatexml.pyo 13${PYSITELIB}/html5lib/_ihatexml.pyo
13${PYSITELIB}/html5lib/_inputstream.py 14${PYSITELIB}/html5lib/_inputstream.py
14${PYSITELIB}/html5lib/_inputstream.pyc 15${PYSITELIB}/html5lib/_inputstream.pyc
15${PYSITELIB}/html5lib/_inputstream.pyo 16${PYSITELIB}/html5lib/_inputstream.pyo
16${PYSITELIB}/html5lib/_tokenizer.py 17${PYSITELIB}/html5lib/_tokenizer.py
17${PYSITELIB}/html5lib/_tokenizer.pyc 18${PYSITELIB}/html5lib/_tokenizer.pyc
18${PYSITELIB}/html5lib/_tokenizer.pyo 19${PYSITELIB}/html5lib/_tokenizer.pyo
19${PYSITELIB}/html5lib/_trie/__init__.py 20${PYSITELIB}/html5lib/_trie/__init__.py

cvs diff -r1.12 -r1.13 pkgsrc/textproc/py-html5lib/distinfo (expand / switch to unified diff)

--- pkgsrc/textproc/py-html5lib/distinfo 2021/11/09 20:10:28 1.12
+++ pkgsrc/textproc/py-html5lib/distinfo 2024/04/30 09:01:14 1.13
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
1$NetBSD: distinfo,v 1.12 2021/11/09 20:10:28 wiz Exp $ 1$NetBSD: distinfo,v 1.13 2024/04/30 09:01:14 wiz Exp $
2 2
3BLAKE2s (html5lib-1.1.tar.gz) = de98dc78f784829b373e37ad38851c062983d16b91322a32a2a77113e34b3240 3BLAKE2s (html5lib-1.1.tar.gz) = de98dc78f784829b373e37ad38851c062983d16b91322a32a2a77113e34b3240
4SHA512 (html5lib-1.1.tar.gz) = af7c29591007fded99be6c38e3d0ae5a4ac32d71d26046a615918ae732cb1c1ecbf754f47ceca1a53726c3843f3ecea7af87a7362281b45ff3af495815818626 4SHA512 (html5lib-1.1.tar.gz) = af7c29591007fded99be6c38e3d0ae5a4ac32d71d26046a615918ae732cb1c1ecbf754f47ceca1a53726c3843f3ecea7af87a7362281b45ff3af495815818626
5Size (html5lib-1.1.tar.gz) = 272215 bytes 5Size (html5lib-1.1.tar.gz) = 272215 bytes
 6SHA1 (patch-html5lib_tests_conftest.py) = 7aefd6920c5b490e0d033003aef2a31cc0b87b86
 7SHA1 (patch-html5lib_tests_sanitizer.py) = 7ef8278779354a83b59001b1c4eb726e668b58ef
 8SHA1 (patch-html5lib_tests_tokenizer.py) = 069535e27579ab9e297986da60ea5072ea15c4f8
 9SHA1 (patch-html5lib_tests_tree__construction.py) = 471730a2408cb7c46e1d76448101f6a708b298f4
 10SHA1 (patch-requirements-test.txt) = e9c89a4bbd6fac87f5143bc4b1f0016993c14450

File Added: pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_conftest.py
$NetBSD: patch-html5lib_tests_conftest.py,v 1.1 2024/04/30 09:01:14 wiz Exp $

https://github.com/html5lib/html5lib-python/pull/506

--- html5lib/tests/conftest.py.orig	2020-06-22 23:23:02.000000000 +0000
+++ 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

File Added: pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_sanitizer.py
$NetBSD: patch-html5lib_tests_sanitizer.py,v 1.1 2024/04/30 09:01:14 wiz Exp $

https://github.com/html5lib/html5lib-python/pull/506

--- html5lib/tests/sanitizer.py.orig	2020-06-22 23:23:02.000000000 +0000
+++ html5lib/tests/sanitizer.py
@@ -13,7 +13,7 @@ class SanitizerFile(pytest.File):
         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):

File Added: pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_tokenizer.py
$NetBSD: patch-html5lib_tests_tokenizer.py,v 1.1 2024/04/30 09:01:14 wiz Exp $

https://github.com/html5lib/html5lib-python/pull/506

--- html5lib/tests/tokenizer.py.orig	2020-06-22 23:23:02.000000000 +0000
+++ html5lib/tests/tokenizer.py
@@ -192,7 +192,7 @@ class TokenizerFile(pytest.File):
             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 @@ class TokenizerTestCollector(pytest.Coll
     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

File Added: pkgsrc/textproc/py-html5lib/patches/patch-html5lib_tests_tree__construction.py
$NetBSD: patch-html5lib_tests_tree__construction.py,v 1.1 2024/04/30 09:01:14 wiz Exp $

https://github.com/html5lib/html5lib-python/pull/506

--- html5lib/tests/tree_construction.py.orig	2020-06-22 23:23:02.000000000 +0000
+++ 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 @@ class TreeConstructionTest(pytest.Collec
                 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 @@ class TreeConstructionTest(pytest.Collec
 
     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

File Added: pkgsrc/textproc/py-html5lib/patches/patch-requirements-test.txt
$NetBSD: patch-requirements-test.txt,v 1.1 2024/04/30 09:01:14 wiz Exp $

https://github.com/html5lib/html5lib-python/pull/506

--- requirements-test.txt.orig	2020-06-10 01:34:36.000000000 +0000
+++ requirements-test.txt
@@ -3,7 +3,7 @@
 tox>=3.15.1,<4
 flake8>=3.8.1,<3.9
 pytest>=4.6.10,<5 ; python_version < '3'
-pytest>=5.4.2,<6 ; python_version >= '3'
+pytest>=5.4.2,<7 ; python_version >= '3'
 coverage>=5.1,<6
 pytest-expect>=1.1.0,<2
 mock>=3.0.5,<4 ; python_version < '3.6'