summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-09-19 07:52:11 +0200
committerMichał Górny <mgorny@gentoo.org>2020-09-19 09:21:10 +0200
commita0d2dae7c192629e561eae046f6cfa6f094f15c1 (patch)
tree07ac1d9a76904b8f351440f4738e51fc09ba27bb /dev-python/bleach
parentdev-python/boto3: Bump to 1.15.1 (diff)
downloadgentoo-a0d2dae7c192629e561eae046f6cfa6f094f15c1.tar.gz
gentoo-a0d2dae7c192629e561eae046f6cfa6f094f15c1.tar.bz2
gentoo-a0d2dae7c192629e561eae046f6cfa6f094f15c1.zip
dev-python/bleach: Bump to 3.2.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/bleach')
-rw-r--r--dev-python/bleach/Manifest1
-rw-r--r--dev-python/bleach/bleach-3.2.1.ebuild39
-rw-r--r--dev-python/bleach/files/bleach-3.2.1-py39.patch48
3 files changed, 88 insertions, 0 deletions
diff --git a/dev-python/bleach/Manifest b/dev-python/bleach/Manifest
index 95124802e073..5e5c1451a1f3 100644
--- a/dev-python/bleach/Manifest
+++ b/dev-python/bleach/Manifest
@@ -1,2 +1,3 @@
DIST bleach-3.1.5.tar.gz 177972 BLAKE2B 6033871f757247f05ee67f66b3596c7a76a9bc5105113206bc8749f9ed103fb6a7c91630540f5f17ddc17e261b24043cc2edcc2562ea7f4cf54774080854de32 SHA512 20db9ab6924a1e884107f30e1059f774b45fd169d3965a61a4ff028e3de17e30be81474d7da89d9275b2173a005c5504a9d11f0e0ca528bf36a9bf08aeed0607
DIST bleach-3.2.0.tar.gz 178910 BLAKE2B e7e97cc367420a656086e5a0e6c1c527348a0edc23c15f5f4b5a40b3079a2fa32b71fd2d99c4db8891e1b2ed06e4ac8ab3d3f0c9a3de77d02499bf32746a9dd7 SHA512 06dd7e22204280a03e37cfc303b4de8fc8776e9ac3f7a4c2451f1ff768b68d97c6b00fa42dc275eb4404dae5e448b9385b4e6ee204fdc7e11f31207cdc3d926a
+DIST bleach-3.2.1.tar.gz 179763 BLAKE2B 5288277ceae1f51fb76c360db72fb646e1d391b3e51f29ba2b25f5dba7704af8ef7cfd2db017237dad42ff4a99e502daa29cdf4edd82952e15842e288c50c0dd SHA512 61710f48f00333b38d251360736e19078063433ca4d7aada210a986f7d79b08c79c64b412686c67f360e4b2e8420c40c4b515eb175ab92bd546f88e2ba0e5835
diff --git a/dev-python/bleach/bleach-3.2.1.ebuild b/dev-python/bleach/bleach-3.2.1.ebuild
new file mode 100644
index 000000000000..4d1438843f60
--- /dev/null
+++ b/dev-python/bleach/bleach-3.2.1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="an easy whitelist-based HTML-sanitizing tool"
+HOMEPAGE="https://github.com/mozilla/bleach https://pypi.org/project/bleach/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+RDEPEND="
+ dev-python/packaging[${PYTHON_USEDEP}]
+ >=dev-python/html5lib-1.0.1-r1[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/webencodings[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/bleach-3.2.1-py39.patch
+)
+
+src_prepare() {
+ # unbundle unpatched broken html5lib
+ rm -r bleach/_vendor || die
+ sed -i -e 's:bleach\._vendor\.::' \
+ bleach/html5lib_shim.py \
+ bleach/sanitizer.py \
+ tests/test_clean.py || die
+
+ distutils-r1_src_prepare
+}
diff --git a/dev-python/bleach/files/bleach-3.2.1-py39.patch b/dev-python/bleach/files/bleach-3.2.1-py39.patch
new file mode 100644
index 000000000000..b281031b3df0
--- /dev/null
+++ b/dev-python/bleach/files/bleach-3.2.1-py39.patch
@@ -0,0 +1,48 @@
+From ccb0d5e98b30577fe27016b5bc774388f02db876 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 19 Sep 2020 08:00:51 +0200
+Subject: [PATCH] Remove tests relying on py<3.9 behavior
+
+---
+ tests/test_clean.py | 15 ---------------
+ 1 file changed, 15 deletions(-)
+
+diff --git a/tests/test_clean.py b/tests/test_clean.py
+index 1cd58df..2b2f7c5 100644
+--- a/tests/test_clean.py
++++ b/tests/test_clean.py
+@@ -499,31 +499,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
+ ('<a href="example.com">foo</a>', {"protocols": []}, "<a>foo</a>"),
+ ('<a href="example.com:8000">foo</a>', {"protocols": []}, "<a>foo</a>"),
+--
+2.28.0
+