summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pyrate-limiter')
-rw-r--r--dev-python/pyrate-limiter/Manifest1
-rw-r--r--dev-python/pyrate-limiter/pyrate-limiter-3.6.1.ebuild75
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-python/pyrate-limiter/Manifest b/dev-python/pyrate-limiter/Manifest
index c4f6f47427ae..55c15d3fb6d2 100644
--- a/dev-python/pyrate-limiter/Manifest
+++ b/dev-python/pyrate-limiter/Manifest
@@ -1,2 +1,3 @@
DIST pyrate-limiter-2.10.0.gh.tar.gz 71838 BLAKE2B 3b8fd16684268870991c3a731c5497802c6f7be51e57bc983a14a7484fad2d0983613304fa061fdb70a3e6645d17fe37fbd68e9ddeca57bc7bd97fef4a5d8585 SHA512 b0090b2d80d40ba2f86ac7b5c5612a35fa885b52a87d783aa9726782275e79ca8d54a9a44b1f0dd43c98bf2355f4c17e1686d7c7f806934ea492b67f66b06ffe
DIST pyrate_limiter-3.6.0.tar.gz 280021 BLAKE2B 4ff5e115376cfb5d860c4cd6437ccbb323e40f96bb81a9933f6f648d029c0f3a1d6674e1a9e1c0309a7087a9d1eb670918ca60d3c960e8acab017e12ffa5c28e SHA512 1f7f92203be443c27e2825022462c51eec2e276a4e58afc129599eacde21da55ed8229b0e5c7af21e650eb896b22c73f5fd227f56c1455cbd8d506894fed73a9
+DIST pyrate_limiter-3.6.1.tar.gz 280264 BLAKE2B 042601c2f80fc855301cda8be4af2547afdfb9532a93a418201db312535a12fa30b2469024ee318a14cb51f4555522b70b6aeef96d41978eb8f8c31d046a0a73 SHA512 b57cbd40473eab549ede0045451d1178dccfcac73f328bf4fe8106172602b52bafe612e2fa2df09f9fe99bdf68c3c7447e8d4f749ba260f3b29656100718c02b
diff --git a/dev-python/pyrate-limiter/pyrate-limiter-3.6.1.ebuild b/dev-python/pyrate-limiter/pyrate-limiter-3.6.1.ebuild
new file mode 100644
index 000000000000..276657b6cf9d
--- /dev/null
+++ b/dev-python/pyrate-limiter/pyrate-limiter-3.6.1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=poetry
+PYTHON_COMPAT=( pypy3 python3_{10..12} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Python Rate-Limiter using Leaky-Bucket Algorimth Family"
+HOMEPAGE="
+ https://github.com/vutran1710/PyrateLimiter/
+ https://pypi.org/project/pyrate-limiter/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-python/filelock[${PYTHON_USEDEP}]
+ dev-python/redis[${PYTHON_USEDEP}]
+"
+
+BDEPEND="
+ test? (
+ dev-db/redis
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_DESELECT=(
+ # Optional dependency redis-py-cluster not packaged
+ "tests/test_02.py::test_redis_cluster"
+)
+EPYTEST_XDIST=1
+
+distutils_enable_sphinx docs \
+ dev-python/sphinx-autodoc-typehints \
+ dev-python/sphinx-copybutton \
+ dev-python/furo \
+ dev-python/myst-parser \
+ dev-python/sphinxcontrib-apidoc
+distutils_enable_tests pytest
+
+src_test() {
+ local redis_pid="${T}"/redis.pid
+ local redis_port=6379
+
+ # Spawn Redis itself for testing purposes
+ einfo "Spawning Redis"
+ einfo "NOTE: Port ${redis_port} must be free"
+ "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start redis server"
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1 ::1
+ ${extra_conf}
+ EOF
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ # postgres tests require psycopg-pool
+ epytest -p asyncio -p rerunfailures --reruns=5 -k "not postgres"
+}