dev-python/bleach: Port to py39
authorMichał Górny <mgorny@gentoo.org>
Wed, 27 May 2020 20:14:54 +0000 (22:14 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 27 May 2020 20:45:05 +0000 (22:45 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/bleach/bleach-3.1.5.ebuild
dev-python/bleach/files/bleach-3.1.5-py39.patch [new file with mode: 0644]

index 43be3b241c1aa288624605d6ac9a6e64b6ee250b..db2a844f98ffa9ad143f44f0b534ef403913fe54 100644 (file)
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
+PYTHON_COMPAT=( python2_7 python3_{6..9} pypy3 )
 
 inherit distutils-r1
 
@@ -24,6 +24,10 @@ RDEPEND="
 
 distutils_enable_tests pytest
 
+PATCHES=(
+       "${FILESDIR}"/${P}-py39.patch
+)
+
 src_prepare() {
        # unbundle unpatched broken html5lib
        rm -r bleach/_vendor || die
diff --git a/dev-python/bleach/files/bleach-3.1.5-py39.patch b/dev-python/bleach/files/bleach-3.1.5-py39.patch
new file mode 100644 (file)
index 0000000..ce12962
--- /dev/null
@@ -0,0 +1,36 @@
+diff --git a/tests/test_clean.py b/tests/test_clean.py
+index 133cd82..4dcb9f4 100644
+--- a/tests/test_clean.py
++++ b/tests/test_clean.py
+@@ -597,31 +597,16 @@ def test_attributes_list():
+         {'protocols': ['http']},
+         '<a href="example.com">valid</a>'
+     ),
+-    (
+-        '<a href="example.com:8000">valid</a>',
+-        {'protocols': ['http']},
+-        '<a href="example.com:8000">valid</a>'
+-    ),
+     (
+         '<a href="localhost">valid</a>',
+         {'protocols': ['http']},
+         '<a href="localhost">valid</a>'
+     ),
+-    (
+-        '<a href="localhost:8000">valid</a>',
+-        {'protocols': ['http']},
+-        '<a href="localhost:8000">valid</a>'
+-    ),
+     (
+         '<a href="192.168.100.100">valid</a>',
+         {'protocols': ['http']},
+         '<a href="192.168.100.100">valid</a>'
+     ),
+-    (
+-        '<a href="192.168.100.100:8000">valid</a>',
+-        {'protocols': ['http']},
+-        '<a href="192.168.100.100:8000">valid</a>'
+-    ),
+     # Disallow implicit http if disallowed
+     (