summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-03 09:32:23 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-03 10:01:08 +0100
commit20c53480ee193e066508fc01b31441b488fc8a0b (patch)
treee67fbf0ebc3d31bc05131cf268e1a1d51ea29afe /dev-python/pyrate-limiter
parentmedia-sound/sidplayfp: bump to 2.6.0 (diff)
downloadgentoo-20c53480ee193e066508fc01b31441b488fc8a0b.tar.gz
gentoo-20c53480ee193e066508fc01b31441b488fc8a0b.tar.bz2
gentoo-20c53480ee193e066508fc01b31441b488fc8a0b.zip
dev-python/pyrate-limiter: Bump to 3.1.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.1.1.ebuild71
2 files changed, 72 insertions, 0 deletions
diff --git a/dev-python/pyrate-limiter/Manifest b/dev-python/pyrate-limiter/Manifest
index 3ecbe7e6c07e..e507a055e810 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.1.0.tar.gz 276659 BLAKE2B 2858b2cbb4805f139ae1a26171e6a1c235eb2d8eb93380f10ed27db16e2983b01b83e7d72d4bf5b44b69710569687e86c1194ea3e1a5ff8750e5966faf5a5b6e SHA512 601b70a380965fc108ec110842170ea73065af38a809c8d103d5061948058590c6a228327ed425e1c69ef30d2c832cb8a61508d326eb3bcd6cbb2df813fa987e
+DIST pyrate_limiter-3.1.1.tar.gz 276906 BLAKE2B 874e6407341d970f360dd8c800ff6910ebf2d3524e5b18cc56189d6cc9c0cb66e6d20287d9581c0ac4c935a2c719633cd72a56ada583c67d7659beefa8c006ce SHA512 f0c94af5ca4aa3c5bef1831b0dd188a67fe0c1ae076277f698880f2867ea81f80e702701185d49e204a2bb1b4b998850f18277cd8e19e759e3974ea573d4eca5
diff --git a/dev-python/pyrate-limiter/pyrate-limiter-3.1.1.ebuild b/dev-python/pyrate-limiter/pyrate-limiter-3.1.1.ebuild
new file mode 100644
index 000000000000..36c4f841a191
--- /dev/null
+++ b/dev-python/pyrate-limiter/pyrate-limiter-3.1.1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2024 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 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/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]"
+ "tests/test_limiter.py::test_limiter_01[clock0-create_sqlite_bucket-False-None]"
+)
+EPYTEST_XDIST=1
+
+# 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
+}