# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-bleach
pkgver=6.3.0
pkgrel=1

pkgdesc="An easy whitelist-based HTML-sanitizing tool"
url="https://pypi.org/project/bleach/"
arch=('any')
license=('Apache-2.0')
depends=('python-packaging'
         'python-webencodings')
makedepends=('python'
             'python-setuptools')
checkdepends=('python-pytest')
optdepends=('python-tinycss2: for CSS sanitisation')

source=(https://pypi.org/packages/source/b/bleach/bleach-$pkgver.tar.gz)

sha256sums=('6f3b91b1c0a02bb9a78b5a454c92506aa0fdf197e1d5e114d2e00c6f64306d22')

prepare() {
	cd "$srcdir"/bleach-$pkgver
}

build() {
	cd "$srcdir"/bleach-$pkgver
	python setup.py build
}

# Upstream broke the test suite.
check() {
	cd "$srcdir"/bleach-$pkgver
	python -m pytest
}

package() {
	cd "$srcdir"/bleach-$pkgver
	python setup.py install --skip-build --optimize=1 --root="$pkgdir"
}
