# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
# NOTE: ensure compatibility with py3-flake8! (#11378)
pkgname=py3-pyflakes
pkgver=3.2.0
pkgrel=1
pkgdesc="passive checker of Python programs"
url="https://github.com/PyCQA/pyflakes"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pyflakes/pyflakes-$pkgver.tar.gz"
builddir="$srcdir/pyflakes-$pkgver"

replaces="py-pyflakes" # Backwards compatibility
provides="py-pyflakes=$pkgver-r$pkgrel" # Backwards compatibility

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() {
	mkdir -p "$pkgdir"/usr/bin
	ln -s pyflakes "$pkgdir"/usr/bin/pyflakes-3

	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
bd413b2ad80ae942bc13cef5ecb3a47b09abb0641fe468d427717b32895eb1702c9e8831867fbaa1de6fff71ab16bc3dae96f745bbc3e7d99de104a008f397ba  pyflakes-3.2.0.tar.gz
"
