summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/fakeredis')
-rw-r--r--dev-python/fakeredis/Manifest1
-rw-r--r--dev-python/fakeredis/fakeredis-2.13.0.ebuild77
2 files changed, 78 insertions, 0 deletions
diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
index bb1bc5b54445..9afeb8c0269e 100644
--- a/dev-python/fakeredis/Manifest
+++ b/dev-python/fakeredis/Manifest
@@ -4,4 +4,5 @@ DIST fakeredis-2.11.1.tar.gz 94897 BLAKE2B 18798d30eccfbedd70d13fc4a9883d2ab4b06
DIST fakeredis-2.11.2.tar.gz 95532 BLAKE2B 5edda6d3573bd589c8144664dbf115f257b68f59f002d92766b4c9ce1a9adcefe727812835d01d4efa42676056e9c050175c423cca166f1063e4ee1a6784ee94 SHA512 a5f0428949f3527fc189ecf4744f2f2310fcb114fdeb718299608defe7dfaeee9720d84debaa1e0e0eeeff11f6426e72452b3e7e772690aa48336996ae5a8716
DIST fakeredis-2.12.0.tar.gz 95952 BLAKE2B 87e27851e2c68c07871990e3b1e73c2c614a902a4e086753308f2abcf01cfe08532c1c04136ebb1fa5aa36ff8b36616fefe70ab3b59860d15e89be5af83d1a9d SHA512 a4c1eb27cb846a769ed5fd10966df77064d0598f7b556c36c0ea48cd298c261f222601a0071652ec279b03e04537aac211710edf1597f6d57a48ca3a53e9a7aa
DIST fakeredis-2.12.1.tar.gz 97486 BLAKE2B 5207d9b946eb5720083b045e29b960cc2eb3ab5ed7b633f00106d0777186cfb02ecc10607d24a67d7b2eded35915e6710a4880f560e49fbca470c487ec0a2b87 SHA512 99e4e0bf7a4be9cc9dc96eecfe2fd1f106664bab2eff4f575468933809cf306c36237ebc9d86efdd9c0823e05a08d466f35a7e43359602b47c582ab16d7bb7ef
+DIST fakeredis-2.13.0.tar.gz 98084 BLAKE2B c147332f2575be7f63aef48199920480d550efbadeee9de255b17cb9c7d6791a059ee3d4bdc500ecf44dcc22de6fdd11d170daf3e19de8e910833b1de12232c6 SHA512 30335e456f7ac2498fc175f9fd154a766064a05e6eb996df9d533412525a3d4279c9359ac5e43a2b9ec9bb1d653639aa10d4e1765a4e4c1bc84f764fa1efdb42
DIST fakeredis-py-2.10.2.gh.tar.gz 159702 BLAKE2B ec385c01af9e32705435148c1c61d74c14d7b22a60b6a3466f1831f557bfe997af6ee96429cfdba00a1328db3cabe1579d65411e7c2b9972e5421963cd66815b SHA512 2a3a87dcbe136465ff0465585562a5b8b0bc73504f491d3ec9c6e959b6cffaa3edbaa1c2e5199138f7a49dfdec3c3da6a2ae338228a8fe21c670a82c062c544a
diff --git a/dev-python/fakeredis/fakeredis-2.13.0.ebuild b/dev-python/fakeredis/fakeredis-2.13.0.ebuild
new file mode 100644
index 000000000000..145808fd6437
--- /dev/null
+++ b/dev-python/fakeredis/fakeredis-2.13.0.ebuild
@@ -0,0 +1,77 @@
+# 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..11} )
+
+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/redis-4.2[${PYTHON_USEDEP}]
+ <dev-python/sortedcontainers-3[${PYTHON_USEDEP}]
+ >=dev-python/sortedcontainers-2.4.0[${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
+}