# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-mypy
pkgver=1.15.0
pkgrel=0
pkgdesc="Optional static typing for Python (PEP484)"
url="https://mypy-lang.org/"
arch="noarch"
license="MIT"
depends="
	py3-mypy-extensions
	py3-typing-extensions
	"
makedepends="python3-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-xdist py3-lxml py3-typed-ast py3-virtualenv"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python/mypy/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/mypy-$pkgver"
options="!check" # they take forever

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

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

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

sha512sums="
dac0c91749215f0ed2a29794665b26b047f9ab918ec387632c2e509308e2051aada6856dbdc7b001a4f3090c0e1b2b4f129f780b64c378997df4d78233065efa  py3-mypy-1.15.0.tar.gz
"
