diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-03-11 04:58:43 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-03-11 05:08:43 +0100 |
commit | 3c8334021742e05e4b1f133ceda77bf919f18800 (patch) | |
tree | 3c762888d1349847ac933cb306912d33be373e17 /dev-python/pyrate-limiter | |
parent | dev-python/flaky: Bump to 3.8.0 (diff) | |
download | gentoo-3c8334021742e05e4b1f133ceda77bf919f18800.tar.gz gentoo-3c8334021742e05e4b1f133ceda77bf919f18800.tar.bz2 gentoo-3c8334021742e05e4b1f133ceda77bf919f18800.zip |
dev-python/pyrate-limiter: Bump to 3.3.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pyrate-limiter')
-rw-r--r-- | dev-python/pyrate-limiter/Manifest | 1 | ||||
-rw-r--r-- | dev-python/pyrate-limiter/pyrate-limiter-3.3.0.ebuild | 74 |
2 files changed, 75 insertions, 0 deletions
diff --git a/dev-python/pyrate-limiter/Manifest b/dev-python/pyrate-limiter/Manifest index e8e7ee329f5a..46dd421a22fd 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.2.1.tar.gz 277166 BLAKE2B eb126b94bc9a113addd1e727ae21ee2df447e1f9fc0b3a1b77ab46464186a0cb62584fafbc9fac1ddbcc7c3289338208dfb39070e57e974e00442b1d7c5f0d21 SHA512 cb782766c2e1e47aeb35c3d7d03f9a82862a53e73b5afdab1b8a255866392cf0636340164c19e4181e8aa4327e9c346fc2fde64b2f50aaf227dd60633038f7c7 +DIST pyrate_limiter-3.3.0.tar.gz 278153 BLAKE2B df0e3aaf53150fb905be994c8bcc268e45bafddf795514eb8a6ee56da25e998b85336f48331a2720cbf501cb6feee806c9c17d99adcb4647979f6d79f960cc9f SHA512 ee2cc0c573c7b696e6a6444eca85b4e5c8315c291b6ab64ed5e60cfd54298cd9aca1efdbfb7a669b92f8169848c03287ecb0a3f50c9281a4bc15acfc1713e300 diff --git a/dev-python/pyrate-limiter/pyrate-limiter-3.3.0.ebuild b/dev-python/pyrate-limiter/pyrate-limiter-3.3.0.ebuild new file mode 100644 index 000000000000..0f5062a73d40 --- /dev/null +++ b/dev-python/pyrate-limiter/pyrate-limiter-3.3.0.ebuild @@ -0,0 +1,74 @@ +# 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 + epytest -p asyncio -p rerunfailures --reruns=5 +} |