# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
pkgname=py3-limits
pkgver=3.6.0
pkgrel=0
pkgdesc="Rate limiting using various strategies and storage backends such as redis & memcached"
url="https://github.com/alisaifee/limits"
arch="noarch"
license="MIT"
depends="
	py3-deprecated
	python3
	"
makedepends="py3-setuptools"
checkdepends="
	py3-flaky
	py3-mongo
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-benchmark
	py3-pytest-cov
	py3-pytest-lazy-fixture
	py3-redis
	"
subpackages="$pkgname-pyc"
options="!check"	# most tests are integration with db connections, assume all connectors installed
source="
	https://github.com/alisaifee/limits/archive/refs/tags/$pkgver/limits-$pkgver.tar.gz

	our-std-is-good-enough.patch
	"
builddir="$srcdir/limits-$pkgver"

build() {
	python3 setup.py build
}

check() {
	pytest \
		-m 'not benchmark and not etcd and not integration and not memcached' \
		-k 'not aio and not Storage and not strategy' -v
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
30cb675c801c770d266363e8367d4a0b2a98ad3e98b1088d1ab11d697b3694cf5318089cacd250fb964c205bcd571158035388bf0c52f536d937cbbb39465b1e  limits-3.6.0.tar.gz
8db0d96f860a07bbc554504a6e94b61546a6be22c0b9736c6b5aca628db9b618efc30609fce3702ee8e3812e1e34329c04d2f34bd69fdaecaa7c7fa0a2bde8a7  our-std-is-good-enough.patch
"
