commit:     3542990b1738c11106113a66b12d5b8493f2d00c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  5 06:07:34 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul  5 06:19:05 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3542990b

dev-python/fakeredis: Bump to 2.16.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/fakeredis/Manifest                |  1 +
 dev-python/fakeredis/fakeredis-2.16.0.ebuild | 78 ++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
index 1a961a2e630d..115090ea2d64 100644
--- a/dev-python/fakeredis/Manifest
+++ b/dev-python/fakeredis/Manifest
@@ -1,2 +1,3 @@
 DIST fakeredis-2.14.1.tar.gz 101789 BLAKE2B 
2e38319aa8bb23c9cd2196d8dbcf489fead785bffa3b464b7e420f28b247c911ea9f3775328f8fec7c26b1a77e32d6a21acf627fe7b603f311b0f3820fa06b54
 SHA512 
71b7f034ad5ccdd569052a82d2e15ec21db4b5a26bc5c660f76bb88c0b7aaa252234e899644dfd63086aaf8a9400ea13acc6439fdca08f84c8392949815f33d2
 DIST fakeredis-2.15.0.tar.gz 108160 BLAKE2B 
aaf135ffc395d6304c2f95b0339610f506382e865039f647a9af3fd9e3fa8cd9b9f6ea6557670fd61e949136f35de10b0fad63a1813d59f5b3697dd200195960
 SHA512 
59bc74a328b85cebcf0ae61d70e4ce26f3cdde3b82de6746f6b33229a6185d542db1e2ddd7c8ea600db69a6c630dbf81998ba108982da33487fe5ad2068abb29
+DIST fakeredis-2.16.0.tar.gz 108416 BLAKE2B 
0897614e567d59b54a35c18922a33cc79e8d2759614fc13b2dfbbf0e52c802470678cdf497b914762f258e84b50afb178ac1a0604acfdb1520daf3a03ac87a6a
 SHA512 
a9fdf6da74c9fc650df9720b39a8c2ecb609353d1c535433bd8ca3ff4674f112e2bb06a381ad8f994e7daab78cc41b1bf1c75a0e287af0b41387bf15d05fce5d

diff --git a/dev-python/fakeredis/fakeredis-2.16.0.ebuild 
b/dev-python/fakeredis/fakeredis-2.16.0.ebuild
new file mode 100644
index 000000000000..12cd5e3de69f
--- /dev/null
+++ b/dev-python/fakeredis/fakeredis-2.16.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 2020-2023 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="Fake implementation of redis API for testing purposes"
+HOMEPAGE="
+       https://github.com/cunla/fakeredis-py/
+       https://pypi.org/project/fakeredis/
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+RDEPEND="
+       dev-python/packaging[${PYTHON_USEDEP}]
+       >=dev-python/redis-4.2[${PYTHON_USEDEP}]
+       <dev-python/sortedcontainers-3[${PYTHON_USEDEP}]
+       >=dev-python/sortedcontainers-2[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       test? (
+               dev-db/redis
+               dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+               dev-python/pytest-mock[${PYTHON_USEDEP}]
+       )
+"
+
+distutils_enable_tests pytest
+
+python_test() {
+       local EPYTEST_DESELECT=(
+               # also lupa
+               test/test_aioredis2.py::test_failed_script_error
+               # TODO
+               "test/test_fakeredis.py::test_set_get_nx[StrictRedis]"
+               "test/test_fakeredis.py::test_lpop_count[StrictRedis]"
+               "test/test_fakeredis.py::test_rpop_count[StrictRedis]"
+               "test/test_fakeredis.py::test_zadd_minus_zero[StrictRedis]"
+               
"test/test_mixins/test_pubsub_commands.py::test_pubsub_channels[StrictRedis]"
+               
test/test_mixins/test_set_commands.py::test_smismember_wrong_type
+       )
+       local EPYTEST_IGNORE=(
+               # these tests fail a lot...
+               test/test_hypothesis.py
+       )
+       local args=(
+               # tests requiring lupa (lua support)
+               -k 'not test_eval and not test_lua and not test_script'
+       )
+       epytest "${args[@]}"
+}
+
+src_test() {
+       local redis_pid="${T}"/redis.pid
+       local redis_port=6379
+
+       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
+       EOF
+
+       # Run the tests
+       distutils-r1_src_test
+
+       # Clean up afterwards
+       kill "$(<"${redis_pid}")" || die
+}

Reply via email to