# Contributor: Newbyte <newbyte@disroot.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-pydantic
pkgver=2.10.4
pkgrel=0
pkgdesc="Data parsing and validation using Python type hints"
url="https://github.com/pydantic/pydantic"
arch="noarch"
license="MIT"
depends="
	py3-annotated-types
	py3-pydantic-core
	py3-typing-extensions
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-hatch-fancy-pypi-readme
	py3-wheel
	"
checkdepends="
	py3-cloudpickle
	py3-dirty-equals
	py3-email-validator
	py3-faker
	py3-hypothesis
	py3-jsonschema
	py3-pytest
	py3-pytest-mock
	py3-pytest-benchmark
	py3-rich
	py3-tzdata
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pydantic/pydantic/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/pydantic-$pkgver"

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 --benchmark-disable \
		--ignore=tests/test_docs.py
}

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

sha512sums="
bc8e5d6af3d41dc72a65123db8159cb29b37c336bc20e31192e2622dcbf9b43d0184147b7852705b38d7293bd65a0c1a9196ba2d751a2fd18d44d03db65818d9  py3-pydantic-2.10.4.tar.gz
"
