# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-watchdog
_pkgname=watchdog
pkgver=6.0.0
pkgrel=0
pkgdesc="Filesystem events monitoring"
url="https://github.com/gorakhargosh/watchdog"
arch="noarch"
license="Apache-2.0"
replaces="py-watchdog" # for backwards compatibility
provides="py-watchdog=$pkgver-r$pkgrel" # for backwards compatibility
depends="py3-yaml"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="
	py3-flaky
	py3-pytest
	py3-pytest-cov
	py3-pytest-timeout
	py3-ruff
	py3-sphinx
	py3-mypy
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$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
	.testenv/bin/python3 -m pytest \
		-k 'not test_auto_restart_on_file_change_debounce and not test_select_fd'
}

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

sha512sums="
a248e05b538a894a00e38dabbc0cc7490bb1a87689aa14aac5835f611136fcf6f1e3bd45a6ca4f10991ffabd9264c72f981f4619bd77eb8baf297d015975d57f  watchdog-6.0.0.tar.gz
"
