commit: 86bc95c3a237377b5bcc92c2d71f7d3f52317cb0 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Mon Aug 12 02:26:05 2024 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Mon Aug 12 02:50:31 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86bc95c3
dev-python/pyrate-limiter: Bump to 3.7.0 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> dev-python/pyrate-limiter/Manifest | 1 + .../pyrate-limiter/pyrate-limiter-3.7.0.ebuild | 75 ++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/dev-python/pyrate-limiter/Manifest b/dev-python/pyrate-limiter/Manifest index 01a84af141bc..d6c6d9676be0 100644 --- a/dev-python/pyrate-limiter/Manifest +++ b/dev-python/pyrate-limiter/Manifest @@ -1 +1,2 @@ DIST pyrate_limiter-3.6.2.tar.gz 280852 BLAKE2B 39b92d5a0486a3b30328d87ea9fe60502c6405761c8d12fa289ca9f8d4583aa12720de3fca7391084edce1ad7b0f000f0c15e488378cd507fb26c54430fe33b4 SHA512 210ac51dc7048f91b2ea2875b40805bb13b1cbcc7b4aa45984430c78ff6c68523b93e8c5915a719fbf20371076ff07fa46c07b1a380988d9748b5d648f08aac5 +DIST pyrate_limiter-3.7.0.tar.gz 281878 BLAKE2B d24a172d8bff6d559ba1adaf5cf9849d61b603bbeb33564d67f3e52182e3952fa8a4a339ae0cdf92c863ba59071084e547b3542a340f224b1f241a05636a3162 SHA512 9b78f343c657c08c6031fc0a36374bef2bcc6808341d804042934b12401bc9362ccd39ff931ee05354733ba1492f35700cc3498ac61d958152324e2f590fb0a9 diff --git a/dev-python/pyrate-limiter/pyrate-limiter-3.7.0.ebuild b/dev-python/pyrate-limiter/pyrate-limiter-3.7.0.ebuild new file mode 100644 index 000000000000..276657b6cf9d --- /dev/null +++ b/dev-python/pyrate-limiter/pyrate-limiter-3.7.0.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" +}