# Contributor: Jacek Pruciak <alpine@juniorjpdj.pl>
# Maintainer: Jacek Pruciak <alpine@juniorjpdj.pl>
pkgname=py3-dirty-equals
pkgver=0.8.0
pkgrel=0
pkgdesc="Doing dirty (but extremely useful) things with equals."
url="https://github.com/samuelcolvin/dirty-equals"
license="MIT"
arch="noarch"
depends="py3-tz"
makedepends="py3-gpep517 py3-installer py3-wheel py3-hatchling"
checkdepends="py3-pytest tzdata"
subpackages="$pkgname-pyc"
source="https://github.com/samuelcolvin/dirty-equals/archive/v$pkgver/dirty-equals-$pkgver.tar.gz"
builddir="$srcdir/dirty-equals-$pkgver"

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

check() {
	# needs pytest-examples but that requires ruff that limits it a bunch
	local ignore="--ignore=tests/test_docs.py"

	# needs pydantic, which introduces circular dep
	ignore="$ignore --ignore=tests/test_other.py"

	# https://github.com/samuelcolvin/dirty-equals/issues/97
	local k="not test_is_datetime[unix-int] and not test_is_datetime[unix-float]"

	pytest $ignore -k "$k"
}

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

sha512sums="
8fc6ee0eefe700c89acf5b2181e502422835a89e8f0bb771b07133bda48b804f09b18e452919c8eb7d50e579b032732edad3e9ec150cd7bc7a33a4db77d9ab5c  dirty-equals-0.8.0.tar.gz
"
