# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-deepdiff
_pkgname=deepdiff
pkgver=8.4.1
pkgrel=0
pkgdesc="Deep Difference and Search of any Python object/data"
url="https://github.com/seperman/deepdiff"
arch="noarch"
license="MIT"
depends="py3-orderly-set py3-orjson py3-click"
makedepends="py3-setuptools py3-gpep517 py3-installer py3-wheel"
# toml/yaml are optional dependencies
checkdepends="
	py3-dateutil
	py3-jsonpickle
	py3-numpy
	py3-pandas
	py3-pytest
	py3-pytest-benchmark
	py3-toml
	py3-tomli-w
	py3-yaml
	"
subpackages="$pkgname-pyc"
source="https://github.com/seperman/deepdiff/archive/refs/tags/$pkgver/deepdiff-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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
	# needs newer pydantic version
	# polars not packaged
	.testenv/bin/python3 -m pytest \
		-k 'not test_pydantic1 and not test_pydantic2' \
		--deselect tests/test_hash.py::TestDeepHashPrep::test_polars
}

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

sha512sums="
b27c104eed78b269255134c5eeaa8a589c1a8cd36f793a7dda128cae67726742cc7d110fafc7bb8dd7c6c1b19a5cae16ef02d23acfe3be323953a7f743504cdb  deepdiff-8.4.1.tar.gz
"
