summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-08-28 06:58:24 +0200
committerMichał Górny <mgorny@gentoo.org>2023-08-28 07:13:43 +0200
commit28cd072af4bc92ffb4c55c19b3e074e3b0071151 (patch)
tree09f8cfd94354a37b83d522768161a95c435c1eb9 /dev-python/pyrate-limiter
parentdev-python/zeroconf: Bump to 0.86.0 (diff)
downloadgentoo-28cd072af4bc92ffb4c55c19b3e074e3b0071151.tar.gz
gentoo-28cd072af4bc92ffb4c55c19b3e074e3b0071151.tar.bz2
gentoo-28cd072af4bc92ffb4c55c19b3e074e3b0071151.zip
dev-python/pyrate-limiter: Bump to 3.0.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
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.0.1.ebuild73
2 files changed, 74 insertions, 0 deletions
diff --git a/dev-python/pyrate-limiter/Manifest b/dev-python/pyrate-limiter/Manifest
index 4e288d151240..048404f5c941 100644
--- a/dev-python/pyrate-limiter/Manifest
+++ b/dev-python/pyrate-limiter/Manifest
@@ -1 +1,2 @@
DIST pyrate-limiter-2.10.0.gh.tar.gz 71838 BLAKE2B 3b8fd16684268870991c3a731c5497802c6f7be51e57bc983a14a7484fad2d0983613304fa061fdb70a3e6645d17fe37fbd68e9ddeca57bc7bd97fef4a5d8585 SHA512 b0090b2d80d40ba2f86ac7b5c5612a35fa885b52a87d783aa9726782275e79ca8d54a9a44b1f0dd43c98bf2355f4c17e1686d7c7f806934ea492b67f66b06ffe
+DIST pyrate_limiter-3.0.1.tar.gz 276145 BLAKE2B f7e861b4abb7269e38a7c4c75d6131c453ee0a8dc8fc48686571d22f87d3c95b0e7d3d1bf99c22966276a9949d60abc4edceadad3db93bf247947c4067dbf6a1 SHA512 4f0656e2f8d38319e58b36c4301860a7c326a2daac85d170dc951a14813dc6f0c7a4995b8bf12a354da6d9e192fdf80fa8d8ee4f77e429e8cfc6f5366a8e415c
diff --git a/dev-python/pyrate-limiter/pyrate-limiter-3.0.1.ebuild b/dev-python/pyrate-limiter/pyrate-limiter-3.0.1.ebuild
new file mode 100644
index 000000000000..47947453dc89
--- /dev/null
+++ b/dev-python/pyrate-limiter/pyrate-limiter-3.0.1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=poetry
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit distutils-r1 multiprocessing 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-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_DESELECT=(
+ # Optional dependency redis-py-cluster not packaged
+ "tests/test_02.py::test_redis_cluster"
+ # Python 3.11 is slightly faster, leading to a non-critical failure here
+ "tests/test_concurrency.py::test_concurrency[ProcessPoolExecutor-SQLiteBucket]"
+)
+
+# TODO: package sphinx-copybutton
+# distutils_enable_sphinx docs \
+# dev-python/sphinx-autodoc-typehints \
+# 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() {
+ epytest -n "$(makeopts_jobs)" --dist=worksteal
+}