# Contributor: Steven Guikal <void@fluix.one>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=py3-pydantic-settings
pkgdesc="Settings management using pydantic"
pkgver=2.6.1
pkgrel=0
arch="noarch"
url="https://github.com/pydantic/pydantic-settings"
license="MIT"
depends="
	python3
	py3-dotenv
	py3-pydantic
	py3-typing-extensions
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-mock
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pydantic/pydantic-settings/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/pydantic-settings-$pkgver

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

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	# test_docs.py needs pytest-examples which is not packaged
	# test_source_azure_key_vault.py requires azure-keyvault-secrets
	testenv/bin/python3 -m pytest --ignore=tests/test_docs.py --ignore tests/test_source_azure_key_vault.py
}

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

sha512sums="
f88e74ddf15f7bbbec644557d5993f9507478e6aff647f233519354b760f058be7d0e0b7e630740ad0516f5dd023f5532c62a17acab758dd19a69049c5cfc4e8  py3-pydantic-settings-2.6.1.tar.gz
"
