summaryrefslogtreecommitdiff
path: root/dev-python/html5lib
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/html5lib')
-rw-r--r--dev-python/html5lib/Manifest8
-rw-r--r--dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch270
-rw-r--r--dev-python/html5lib/html5lib-0.9999999.ebuild1
-rw-r--r--dev-python/html5lib/html5lib-0.999999999.ebuild1
-rw-r--r--dev-python/html5lib/html5lib-1.0.1-r1.ebuild36
-rw-r--r--dev-python/html5lib/html5lib-1.0.1.ebuild2
6 files changed, 315 insertions, 3 deletions
diff --git a/dev-python/html5lib/Manifest b/dev-python/html5lib/Manifest
index f57fe861a1bb..73ce00b1e46d 100644
--- a/dev-python/html5lib/Manifest
+++ b/dev-python/html5lib/Manifest
@@ -1,7 +1,9 @@
+AUX html5lib-python-1.0.1-support-pytest4.patch 13579 BLAKE2B 723c8a77f2008978378c54a889cdd3cc28f33993d16654dff6ad7dbff69a42dcdef7c3cbd57677c88bec9650fdccdd754b488c956146168290661090a4702c9e SHA512 51435c4094fa0e0c423e21c15709e5ebe10546cbea3ac97635c3d1ebef9287d6c42a479075cc790ccf233c67924a518638d6618f073df2b0871da3fb2838e10e
DIST html5lib-0.9999999.tar.gz 889312 BLAKE2B 49cbab503692a1044ef37b11d9b776fb0378c19f1cbe05b259b4653d248e3571e5578d7879ab3ec5df2e750db74c353acc98d1d6e8556949c1b1efb62f38c116 SHA512 1748a1921f4bc93b7f208d89701eeabfe507e40515dd2e88ece239ba7c1704c8ae9dc4eea310164c7b207225dce910f78a8b34f826f4f87a2992365c07089c28
DIST html5lib-0.999999999.tar.gz 245488 BLAKE2B 3d2409f18e7ff6b6882e163b782703a7d2b2d42f8c131ab05a51499a4cd23d75ff8d097c1ce87e9f28e8ce649bec8099d364f4d01ee64d0efdfc75fba1d01067 SHA512 b30d9ea74d0ad03e07ebee0d33caefeed717e6084f2ef44559ebf73948563ffd60e40c774e23c8964a32b0f265d1d1f0b98759861acaa208f28e5ab2813c3ca0
DIST html5lib-1.0.1.tar.gz 252959 BLAKE2B d2a9fa19d6a18b9e0c39f737a22ff4d5a6533734843f787c083f9497fd94788dad0e1e96478fe48b262c208370cf58e91ab94cc06a3e2757a40e936363cd3148 SHA512 35939b4450893864da04e735ee5e0addacf1dd34bae6a6909c76572abf6bfded446a78a713dfde91c1485ba45867d7abeb6a45cf0545c16ea968707be7de5dd2
-EBUILD html5lib-0.9999999.ebuild 1068 BLAKE2B 2f31610f5f160823ffec3b2fb3970c058751e00ab2f641c063df75f36b099918ad16d73e32ea4bf2c756eb1dde17032012ac28f59aa7284d03895076a0c90fbe SHA512 d6ff8bfbd5ca47fd05793a699fb27c8319b409a2ce83754f79ccde754a331f4583621c256caa97b1061371f298f07508e8f6d3a73a7cb438c9ffabdce2fee765
-EBUILD html5lib-0.999999999.ebuild 889 BLAKE2B 0766ec7a5a395a0ed97df86b491f7cbdc0b6b94f3b44085506765cee4cfe04eb91fd305ff78ea9992b133728271724eae2c67b2ed135f9f3ab706e2f31675226 SHA512 563977d6760b2e9dcd477ef50402fa55ddc20c1b7a6b070106f5683f53d03377f610e11ba10b3bf134fa38e1be94403f2f78e1aacc58de2c2b4c05291aa69262
-EBUILD html5lib-1.0.1.ebuild 888 BLAKE2B bc0e1877becb5cac6fe3d75ea35d4206e154142bfdd357298fb5d3f6f0975de5bbaac38d127a3539654b0d3e18539b705dcf870f25cfd43eb7211fa5fb2e7cc4 SHA512 fb69c8660d4914c612892df088c7fc8ed6b5136f818925e88bf20661db5c612264eea45ae8f2aba415d302bc97015ccbbc3fbba48fe3cbce3db60c46360bb271
+EBUILD html5lib-0.9999999.ebuild 1095 BLAKE2B 3a2e4e21a3c911559dfa7dd16727c22f3e8761d39e0fcbc895f1dfbd840d5bd9ff39ab0260a101c2fd2448ba3c51dd779af5e71b793ea861ee344a37bd8b39fb SHA512 21b594c6b3a0a1a0f6cba47666cddfbb6baed899d150950b50c6a5bef862c31f4bb401f3614d0211a17ef9486b6aaaa6a772735839c0752fb3ce31c2ae79743c
+EBUILD html5lib-0.999999999.ebuild 916 BLAKE2B 5431a1cc42080e77ceae07b2e2ec490219784e2667afde114b886f50c3580a53492a74a2b1781b7cee9f01199405d334a4832ce51f048e32c774a53b22d7f5af SHA512 07a92d47da5f65b734c9392f9cbaad6e38c91cc8bde9c59652708ff83aa6fa754d9984ba5f20a019079e108bf69c6ce418048572d2559bafd9aafd64a27ca99f
+EBUILD html5lib-1.0.1-r1.ebuild 980 BLAKE2B 957c04fba00898c68ff659fc05ee985937293c0f885f73f2f7abab508e9d0581b622f145ec05e40a0e90488045af5c51a13a4c509ccb8861a259cd743c0df8f2 SHA512 76bbfd794d79cc14745e39386cce6d86f6d115315a641a7e2366371dbf4b0b3d71b754f9b867734391582ec722d6a133d8f817eb13eb42927ea6009dc11d67a0
+EBUILD html5lib-1.0.1.ebuild 916 BLAKE2B 243bc80cf44ffcdef9fe18a9f9ef09da4c309e841ae8aaab4d20bdc3debd1864a0fc1e7a15c8e9d591e0ea837eab19570f774616f7e1a1ce37c8a8b28c9a953a SHA512 1526660605fa25448660e8cc9fdea3d3ece8fc7c65435c6ea13d891cf82988da2a50a15fe34d418a74130db4653e63215d08eef2c54b962e9e0460f60ea8cd25
MISC metadata.xml 589 BLAKE2B d98d80202c045607de5843e34313a06e9493c50bb1154e3f90a7c1c9236de2b4369827d35cb8540125524b54c0453ce56ca7ecf3a359bd9bab6e548ea1377f9f SHA512 b619c0adb0c781b00e656b1027465ec19d1ab7d0792475f197ab4164cb8a1c26563dcf48d147e346637789c8ec1603afaea428357c1022c42e22b85967e1694a
diff --git a/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch b/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch
new file mode 100644
index 000000000000..98c9fb23fc77
--- /dev/null
+++ b/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch
@@ -0,0 +1,270 @@
+From 2699544837e68b12f1740a7eb56882a0dc0a4008 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@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 &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; 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,
++ mark=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
+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?= <mcepl@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 &lt;bad&gt;bar&lt;/bad&gt; baz",
+- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name))
++ "<img title=\"1\"/>foo &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; baz<br/>",
+- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name))
++ "<br title=\"1\"/>foo &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; baz" % tag_name,
+- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name))
++ "<%s title=\"1\"/>foo &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; baz</%s>" % (tag_name, tag_name),
+- "<%s title='1'>foo <bad>bar</bad> baz</%s>" % (tag_name, tag_name))
++ "<%s title=\"1\">foo &lt;bad&gt;bar&lt;/bad&gt; 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 &lt;bad&gt;bar&lt;/bad&gt; baz</p>" % (attribute_name, attribute_value),
+- "<p %s='%s'>foo <bad>bar</bad> baz</p>" % (attribute_name, attribute_value))
++ "<p %s=\"%s\">foo &lt;bad&gt;bar&lt;/bad&gt; 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?= <mcepl@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
diff --git a/dev-python/html5lib/html5lib-0.9999999.ebuild b/dev-python/html5lib/html5lib-0.9999999.ebuild
index ea6e01d7b644..c104dbfa8838 100644
--- a/dev-python/html5lib/html5lib-0.9999999.ebuild
+++ b/dev-python/html5lib/html5lib-0.9999999.ebuild
@@ -16,6 +16,7 @@ LICENSE="MIT"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
IUSE="test"
+RESTRICT="!test? ( test )"
RDEPEND="dev-python/six[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
diff --git a/dev-python/html5lib/html5lib-0.999999999.ebuild b/dev-python/html5lib/html5lib-0.999999999.ebuild
index 4487607de5ad..1f16891c8f27 100644
--- a/dev-python/html5lib/html5lib-0.999999999.ebuild
+++ b/dev-python/html5lib/html5lib-0.999999999.ebuild
@@ -16,6 +16,7 @@ LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x64-macos"
IUSE="test"
+RESTRICT="!test? ( test )"
RDEPEND="dev-python/six[${PYTHON_USEDEP}]
dev-python/webencodings[${PYTHON_USEDEP}]"
diff --git a/dev-python/html5lib/html5lib-1.0.1-r1.ebuild b/dev-python/html5lib/html5lib-1.0.1-r1.ebuild
new file mode 100644
index 000000000000..751b9bc332dc
--- /dev/null
+++ b/dev-python/html5lib/html5lib-1.0.1-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{5,6,7,8}} pypy{,3} )
+PYTHON_REQ_USE="xml(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="HTML parser based on the HTML5 specification"
+HOMEPAGE="https://github.com/html5lib/html5lib-python/ https://html5lib.readthedocs.org"
+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 ~s390 ~sparc ~x86 ~x64-macos"
+IUSE="test"
+
+RDEPEND=">=dev-python/six-1.9[${PYTHON_USEDEP}]
+ dev-python/webencodings[${PYTHON_USEDEP}]"
+BDEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/pytest-expect[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ )"
+
+RESTRICT+=" !test? ( test )"
+
+PATCHES=(
+ # https://github.com/html5lib/html5lib-python/pull/429
+ "${FILESDIR}/html5lib-python-1.0.1-support-pytest4.patch"
+)
+
+distutils_enable_tests pytest
diff --git a/dev-python/html5lib/html5lib-1.0.1.ebuild b/dev-python/html5lib/html5lib-1.0.1.ebuild
index e6da9bacdd22..c67285351b05 100644
--- a/dev-python/html5lib/html5lib-1.0.1.ebuild
+++ b/dev-python/html5lib/html5lib-1.0.1.ebuild
@@ -27,6 +27,8 @@ DEPEND="${RDEPEND}
dev-python/mock[${PYTHON_USEDEP}]
)"
+RESTRICT="!test? ( test )"
+
python_test() {
py.test -v || die "Tests fail with ${EPYTHON}"
}