Date: Friday, November 13, 2020 @ 12:07:09 Author: eschwartz Revision: 753888
archrelease: copy trunk to community-any Added: python-html5lib/repos/community-any/PKGBUILD (from rev 753887, python-html5lib/trunk/PKGBUILD) Deleted: python-html5lib/repos/community-any/PKGBUILD python-html5lib/repos/community-any/pytest4.patch ---------------+ PKGBUILD | 132 +++++++++++++------------- pytest4.patch | 279 -------------------------------------------------------- 2 files changed, 68 insertions(+), 343 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2020-11-13 12:06:53 UTC (rev 753887) +++ PKGBUILD 2020-11-13 12:07:09 UTC (rev 753888) @@ -1,64 +0,0 @@ -# Maintainer: Eli Schwartz <eschwa...@archlinux.org> -# Maintainer: Jelle van der Waa <je...@archlinux.org> -# Contributor: Daniel J Griffiths <ghost1...@archlinux.us> -# Contributor: Erol V. Aktay <e.ak...@gmail.com> - -pkgbase=python-html5lib -pkgname=('python2-html5lib' 'python-html5lib') -pkgver=1.1 -pkgrel=1 -arch=('any') -url="https://github.com/html5lib" -license=('MIT') -_deps=('six' 'webencodings') -makedepends=('python-setuptools' 'python2-setuptools' "${_deps[@]/#/python-}" "${_deps[@]/#/python2-}") -_checkdeps=('pytest' 'pytest-expect' 'lxml' 'mock') -checkdepends=("${_checkdeps[@]/#/python-}" "${_checkdeps[@]/#/python2-}") -_test_commit=c305da74fae50fb018870de7a042da36c1a93b65 -source=("$pkgbase-$pkgver.tar.gz::https://github.com/html5lib/html5lib-python/archive/${pkgver}.tar.gz" - "https://github.com/html5lib/html5lib-tests/archive/${_test_commit}.tar.gz") -sha256sums=('66e9e24a53c10c27abb6be8a3cf2cf55824c6ea1cef8570a633cb223ec46e894' - 'cb261423c644b3469ac66926e290060b481371d0952995d270492fc761d0209a') - -prepare() { - cd "${srcdir}"/html5lib-python-${pkgver} - - rmdir html5lib/tests/testdata - ln -sfT ../../../html5lib-tests-${_test_commit} html5lib/tests/testdata -} - -build() { - cd "${srcdir}"/html5lib-python-${pkgver} - - python setup.py build - python2 setup.py build -} - -check() { - cd "${srcdir}"/html5lib-python-${pkgver} - - py.test - py.test2 -} - -package_python-html5lib() { - pkgdesc="A Python HTML parser/tokenizer based on the WHATWG HTML5 spec" - depends=("${_deps[@]/#/python-}") - optdepends=('python-lxml: lxml treebuilder' - 'python-genshi: genshi treewalker') - cd "${srcdir}"/html5lib-python-${pkgver} - - python setup.py install --root="${pkgdir}" --optimize=1 --skip-build - install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE -} - -package_python2-html5lib() { - pkgdesc="A Python2 HTML parser/tokenizer based on the WHATWG HTML5 spec" - depends=("${_deps[@]/#/python2-}") - optdepends=('python2-lxml: lxml treebuilder' - 'python2-genshi: genshi treewalker') - cd "${srcdir}"/html5lib-python-${pkgver} - - python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build - install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE -} Copied: python-html5lib/repos/community-any/PKGBUILD (from rev 753887, python-html5lib/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2020-11-13 12:07:09 UTC (rev 753888) @@ -0,0 +1,68 @@ +# Maintainer: Eli Schwartz <eschwa...@archlinux.org> +# Maintainer: Jelle van der Waa <je...@archlinux.org> +# Contributor: Daniel J Griffiths <ghost1...@archlinux.us> +# Contributor: Erol V. Aktay <e.ak...@gmail.com> + +pkgbase=python-html5lib +pkgname=('python2-html5lib' 'python-html5lib') +pkgver=1.1 +pkgrel=4 +arch=('any') +url="https://github.com/html5lib" +license=('MIT') +_deps=('six' 'webencodings') +makedepends=('python-setuptools' 'python2-setuptools' "${_deps[@]/#/python-}" "${_deps[@]/#/python2-}") +_checkdeps=('pytest' 'pytest-expect' 'lxml' 'mock') +checkdepends=("${_checkdeps[@]/#/python-}" "${_checkdeps[@]/#/python2-}") +_test_commit=71eebd59772d1d39aced0c0582ae9c09acf3ce6e +source=("$pkgbase-$pkgver.tar.gz::https://github.com/html5lib/html5lib-python/archive/${pkgver}.tar.gz" + "https://github.com/html5lib/html5lib-python/commit/2c19b9899ab3a3e8bd0ca35e5d78544334204169.patch" + "https://github.com/html5lib/html5lib-tests/archive/${_test_commit}.tar.gz") +sha256sums=('66e9e24a53c10c27abb6be8a3cf2cf55824c6ea1cef8570a633cb223ec46e894' + '6f37b33667e35ea138279be9842f012792821b1497b81ae4b108a74180cfe249' + 'c866f5e4ae9ef34313e2b61fcb74849b6f8aef970bf8249956b6a5d142197087') + +prepare() { + cd "${srcdir}"/html5lib-python-${pkgver} + + # fix pytest 6 compat + patch -p1 -i ../2c19b9899ab3a3e8bd0ca35e5d78544334204169.patch + + rmdir html5lib/tests/testdata + ln -sfT ../../../html5lib-tests-${_test_commit} html5lib/tests/testdata +} + +build() { + cd "${srcdir}"/html5lib-python-${pkgver} + + python setup.py build + python2 setup.py build +} + +check() { + cd "${srcdir}"/html5lib-python-${pkgver} + + py.test + py.test2 +} + +package_python-html5lib() { + pkgdesc="A Python HTML parser/tokenizer based on the WHATWG HTML5 spec" + depends=("${_deps[@]/#/python-}") + optdepends=('python-lxml: lxml treebuilder' + 'python-genshi: genshi treewalker') + cd "${srcdir}"/html5lib-python-${pkgver} + + python setup.py install --root="${pkgdir}" --optimize=1 --skip-build + install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE +} + +package_python2-html5lib() { + pkgdesc="A Python2 HTML parser/tokenizer based on the WHATWG HTML5 spec" + depends=("${_deps[@]/#/python2-}") + optdepends=('python2-lxml: lxml treebuilder') + cd "${srcdir}"/html5lib-python-${pkgver} + + python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build + install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE +} Deleted: pytest4.patch =================================================================== --- pytest4.patch 2020-11-13 12:06:53 UTC (rev 753887) +++ pytest4.patch 2020-11-13 12:07:09 UTC (rev 753888) @@ -1,279 +0,0 @@ -From 2699544837e68b12f1740a7eb56882a0dc0a4008 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <m...@hroncok.cz> -Date: Thu, 28 Mar 2019 01:45:43 +0100 -Subject: [PATCH 1/4] Support pytest 4 - -Fixes https://github.com/html5lib/html5lib-python/issues/411 ---- - html5lib/tests/test_encoding.py | 4 ++-- - html5lib/tests/test_sanitizer.py | 14 +++++++------- - html5lib/tests/test_serializer.py | 2 +- - html5lib/tests/test_stream.py | 7 ++++--- - html5lib/tests/test_treewalkers.py | 2 +- - requirements-test.txt | 2 +- - tox.ini | 2 +- - 7 files changed, 17 insertions(+), 16 deletions(-) - -diff --git a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py -index 9a411c77..97b6ca2a 100644 ---- a/html5lib/tests/test_encoding.py -+++ b/html5lib/tests/test_encoding.py -@@ -99,8 +99,8 @@ def test_encoding(): - for filename in get_data_files("encoding"): - tests = _TestData(filename, b"data", encoding=None) - for test in tests: -- yield (runParserEncodingTest, test[b'data'], test[b'encoding']) -- yield (runPreScanEncodingTest, test[b'data'], test[b'encoding']) -+ runParserEncodingTest(test[b'data'], test[b'encoding']) -+ runPreScanEncodingTest(test[b'data'], test[b'encoding']) - - - # pylint:disable=wrong-import-position -diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py -index 45046d57..1b7285fc 100644 ---- a/html5lib/tests/test_sanitizer.py -+++ b/html5lib/tests/test_sanitizer.py -@@ -67,19 +67,19 @@ def test_sanitizer(): - 'tfoot', 'th', 'thead', 'tr', 'select']: - continue # TODO - if tag_name == 'image': -- yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, -+ runSanitizerTest("test_should_allow_%s_tag" % tag_name, - "<img title=\"1\"/>foo <bad>bar</bad> baz", - "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) - elif tag_name == 'br': -- yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, -+ runSanitizerTest("test_should_allow_%s_tag" % tag_name, - "<br title=\"1\"/>foo <bad>bar</bad> baz<br/>", - "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) - elif tag_name in constants.voidElements: -- yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, -+ runSanitizerTest("test_should_allow_%s_tag" % tag_name, - "<%s title=\"1\"/>foo <bad>bar</bad> baz" % tag_name, - "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) - else: -- yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, -+ runSanitizerTest("test_should_allow_%s_tag" % tag_name, - "<%s title=\"1\">foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name), - "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) - -@@ -93,7 +93,7 @@ def test_sanitizer(): - attribute_value = 'foo' - if attribute_name in sanitizer.attr_val_is_uri: - attribute_value = '%s://sub.domain.tld/path/object.ext' % sanitizer.allowed_protocols[0] -- yield (runSanitizerTest, "test_should_allow_%s_attribute" % attribute_name, -+ runSanitizerTest("test_should_allow_%s_attribute" % attribute_name, - "<p %s=\"%s\">foo <bad>bar</bad> baz</p>" % (attribute_name, attribute_value), - "<p %s='%s'>foo <bad>bar</bad> baz</p>" % (attribute_name, attribute_value)) - -@@ -101,7 +101,7 @@ def test_sanitizer(): - rest_of_uri = '//sub.domain.tld/path/object.ext' - if protocol == 'data': - rest_of_uri = 'image/png;base64,aGVsbG8gd29ybGQ=' -- yield (runSanitizerTest, "test_should_allow_uppercase_%s_uris" % protocol, -+ runSanitizerTest("test_should_allow_uppercase_%s_uris" % protocol, - "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), - """<img src="%s:%s">foo</a>""" % (protocol, rest_of_uri)) - -@@ -110,7 +110,7 @@ def test_sanitizer(): - if protocol == 'data': - rest_of_uri = 'image/png;base64,aGVsbG8gd29ybGQ=' - protocol = protocol.upper() -- yield (runSanitizerTest, "test_should_allow_uppercase_%s_uris" % protocol, -+ runSanitizerTest("test_should_allow_uppercase_%s_uris" % protocol, - "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), - """<img src="%s:%s">foo</a>""" % (protocol, rest_of_uri)) - -diff --git a/html5lib/tests/test_serializer.py b/html5lib/tests/test_serializer.py -index c23592af..a4250935 100644 ---- a/html5lib/tests/test_serializer.py -+++ b/html5lib/tests/test_serializer.py -@@ -222,4 +222,4 @@ def test_serializer(): - with open(filename) as fp: - tests = json.load(fp) - for test in tests['tests']: -- yield runSerializerTest, test["input"], test["expected"], test.get("options", {}) -+ runSerializerTest(test["input"], test["expected"], test.get("options", {})) -diff --git a/html5lib/tests/test_stream.py b/html5lib/tests/test_stream.py -index 27c39538..a9b3ebbe 100644 ---- a/html5lib/tests/test_stream.py -+++ b/html5lib/tests/test_stream.py -@@ -308,9 +308,10 @@ def test_invalid_codepoints(inp, num): - ("'\\uD800\\uD800\\uD800'", 3), - ("'a\\uD800a\\uD800a\\uD800a'", 3), - ("'\\uDFFF\\uDBFF'", 2), -- pytest.mark.skipif(sys.maxunicode == 0xFFFF, -- ("'\\uDBFF\\uDFFF'", 2), -- reason="narrow Python")]) -+ pytest.param( -+ "'\\uDBFF\\uDFFF'", 2, -+ marks=pytest.mark.skipif(sys.maxunicode == 0xFFFF, -+ reason="narrow Python"))]) - def test_invalid_codepoints_surrogates(inp, num): - inp = eval(inp) # pylint:disable=eval-used - fp = StringIO(inp) -diff --git a/html5lib/tests/test_treewalkers.py b/html5lib/tests/test_treewalkers.py -index 67fc89e5..c2323b7e 100644 ---- a/html5lib/tests/test_treewalkers.py -+++ b/html5lib/tests/test_treewalkers.py -@@ -99,7 +99,7 @@ def test_treewalker_six_mix(): - - for tree in sorted(treeTypes.items()): - for intext, attrs, expected in sm_tests: -- yield runTreewalkerEditTest, intext, expected, attrs, tree -+ runTreewalkerEditTest(intext, expected, attrs, tree) - - - @pytest.mark.parametrize("tree,char", itertools.product(sorted(treeTypes.items()), ["x", "\u1234"])) -diff --git a/requirements-test.txt b/requirements-test.txt -index 4e223a3f..b936e0fa 100644 ---- a/requirements-test.txt -+++ b/requirements-test.txt -@@ -4,7 +4,7 @@ tox - - flake8<3.0 - --pytest==3.2.5 -+pytest>=4.3,<4.4 - coverage - pytest-expect>=1.1,<2.0 - mock -From 7647f80e590141769c288e4d91c2e417af118725 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mc...@cepl.eu> -Date: Fri, 1 Nov 2019 12:20:37 +0100 -Subject: [PATCH 2/4] Fix the patch by Miro Hroncok - ---- - html5lib/tests/test_encoding.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py -index 97b6ca2a..9f137e7a 100644 ---- a/html5lib/tests/test_encoding.py -+++ b/html5lib/tests/test_encoding.py -@@ -95,6 +95,7 @@ def runPreScanEncodingTest(data, encoding): - assert encoding == stream.charEncoding[0].name, errorMessage(data, encoding, stream.charEncoding[0].name) - - -+@pytest.mark.skip(reason="broken under pytest4") - def test_encoding(): - for filename in get_data_files("encoding"): - tests = _TestData(filename, b"data", encoding=None) - -From 8ded69fdc0ae45f0531e1633927beb2190ab18a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mc...@cepl.eu> -Date: Fri, 8 Nov 2019 15:28:00 +0100 -Subject: [PATCH 3/4] Make flake8 happy - ---- - html5lib/tests/test_sanitizer.py | 44 ++++++++++++++++++++------------ - 1 file changed, 27 insertions(+), 17 deletions(-) - -diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py -index 1b7285fc..a29d5ef3 100644 ---- a/html5lib/tests/test_sanitizer.py -+++ b/html5lib/tests/test_sanitizer.py -@@ -63,25 +63,32 @@ def test_sanitizer(): - for ns, tag_name in sanitizer.allowed_elements: - if ns != constants.namespaces["html"]: - continue -- if tag_name in ['caption', 'col', 'colgroup', 'optgroup', 'option', 'table', 'tbody', 'td', -- 'tfoot', 'th', 'thead', 'tr', 'select']: -+ if tag_name in ['caption', 'col', 'colgroup', 'optgroup', 'option', -+ 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', -+ 'tr', 'select']: - continue # TODO - if tag_name == 'image': - runSanitizerTest("test_should_allow_%s_tag" % tag_name, -- "<img title=\"1\"/>foo <bad>bar</bad> baz", -- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) -+ "<img title=\"1\"/>foo <bad>bar</bad> baz", -+ "<%s title='1'>foo <bad>bar</bad> baz</%s>" % -+ (tag_name, tag_name)) - elif tag_name == 'br': - runSanitizerTest("test_should_allow_%s_tag" % tag_name, -- "<br title=\"1\"/>foo <bad>bar</bad> baz<br/>", -- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) -+ "<br title=\"1\"/>foo <bad>bar</bad> baz<br/>", -+ "<%s title='1'>foo <bad>bar</bad> baz</%s>" % -+ (tag_name, tag_name)) - elif tag_name in constants.voidElements: - runSanitizerTest("test_should_allow_%s_tag" % tag_name, -- "<%s title=\"1\"/>foo <bad>bar</bad> baz" % tag_name, -- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) -+ "<%s title=\"1\"/>foo <bad>bar</bad> baz" % -+ tag_name, -+ "<%s title='1'>foo <bad>bar</bad> baz</%s>" % -+ (tag_name, tag_name)) - else: - runSanitizerTest("test_should_allow_%s_tag" % tag_name, -- "<%s title=\"1\">foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name), -- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name)) -+ "<%s title=\"1\">foo <bad>bar</bad> baz</%s>" % -+ (tag_name, tag_name), -+ "<%s title='1'>foo <bad>bar</bad> baz</%s>" % -+ (tag_name, tag_name)) - - for ns, attribute_name in sanitizer.allowed_attributes: - if ns is not None: -@@ -92,18 +99,21 @@ def test_sanitizer(): - continue - attribute_value = 'foo' - if attribute_name in sanitizer.attr_val_is_uri: -- attribute_value = '%s://sub.domain.tld/path/object.ext' % sanitizer.allowed_protocols[0] -+ attribute_value = '%s://sub.domain.tld/path/object.ext' \ -+ % sanitizer.allowed_protocols[0] - runSanitizerTest("test_should_allow_%s_attribute" % attribute_name, -- "<p %s=\"%s\">foo <bad>bar</bad> baz</p>" % (attribute_name, attribute_value), -- "<p %s='%s'>foo <bad>bar</bad> baz</p>" % (attribute_name, attribute_value)) -+ "<p %s=\"%s\">foo <bad>bar</bad> baz</p>" % -+ (attribute_name, attribute_value), -+ "<p %s='%s'>foo <bad>bar</bad> baz</p>" % -+ (attribute_name, attribute_value)) - - for protocol in sanitizer.allowed_protocols: - rest_of_uri = '//sub.domain.tld/path/object.ext' - if protocol == 'data': - rest_of_uri = 'image/png;base64,aGVsbG8gd29ybGQ=' - runSanitizerTest("test_should_allow_uppercase_%s_uris" % protocol, -- "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), -- """<img src="%s:%s">foo</a>""" % (protocol, rest_of_uri)) -+ "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), -+ '<img src="%s:%s">foo</a>' % (protocol, rest_of_uri)) - - for protocol in sanitizer.allowed_protocols: - rest_of_uri = '//sub.domain.tld/path/object.ext' -@@ -111,8 +121,8 @@ def test_sanitizer(): - rest_of_uri = 'image/png;base64,aGVsbG8gd29ybGQ=' - protocol = protocol.upper() - runSanitizerTest("test_should_allow_uppercase_%s_uris" % protocol, -- "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), -- """<img src="%s:%s">foo</a>""" % (protocol, rest_of_uri)) -+ "<img src=\"%s:%s\">foo</a>" % (protocol, rest_of_uri), -+ '<img src="%s:%s">foo</a>' % (protocol, rest_of_uri)) - - - def test_lowercase_color_codes_in_style(): - -From b4d066b2d9b4ea1135183c6500565c2ab8758bf1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mc...@cepl.eu> -Date: Fri, 8 Nov 2019 16:17:19 +0100 -Subject: [PATCH 4/4] No limits on the upper version of pytest - ---- - requirements-test.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/requirements-test.txt b/requirements-test.txt -index b936e0fa..1cd46922 100644 ---- a/requirements-test.txt -+++ b/requirements-test.txt -@@ -4,7 +4,7 @@ tox - - flake8<3.0 - --pytest>=4.3,<4.4 -+pytest>=4.3 - coverage - pytest-expect>=1.1,<2.0 - mock