# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tinycss2
pkgver=1.3.0
pkgrel=0
pkgdesc="Low-level CSS parser for Python"
url="https://pypi.org/project/tinycss2"
arch="noarch"
license="BSD-3-Clause"
depends="py3-webencodings"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-flit-core"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/t/tinycss2/tinycss2-$pkgver.tar.gz"
builddir="$srcdir/tinycss2-$pkgver"
replaces="py-tinycss py2-tinycss py3-tinycss"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
d215ba2d8c580ca785bc2c3e33c8ae220c085e3ec1b932c01f81e176987c48559867af186056e2c501541d1d337b4fc33eea7ff2feba490e81076608b7c3aaee  tinycss2-1.3.0.tar.gz
"
