summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-09-16 11:43:07 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-09-16 11:43:07 +0300
commitde67e28d69134f639c6dd5dfa16b1138c2470e6d (patch)
treea6addbdd54edb85cf14a23fdf4951bc1d066f670 /dev-python/fakeredis
parentapp-misc/asciinema: enable py3.10, cleanup (diff)
downloadgentoo-de67e28d69134f639c6dd5dfa16b1138c2470e6d.tar.gz
gentoo-de67e28d69134f639c6dd5dfa16b1138c2470e6d.tar.bz2
gentoo-de67e28d69134f639c6dd5dfa16b1138c2470e6d.zip
dev-python/fakeredis: add 1.6.1
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/fakeredis')
-rw-r--r--dev-python/fakeredis/Manifest1
-rw-r--r--dev-python/fakeredis/fakeredis-1.6.1.ebuild76
2 files changed, 77 insertions, 0 deletions
diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
index 86c02f6b2d57..cf11b444080a 100644
--- a/dev-python/fakeredis/Manifest
+++ b/dev-python/fakeredis/Manifest
@@ -1,2 +1,3 @@
DIST fakeredis-1.5.1.gh.tar.gz 67064 BLAKE2B 6eac029b7de6fb2c9b56a60655b6a224cdcba25fa86662a0423044ab97248984c4c6cfbaacbe4bbb2e3fc6826693791f232c6c55d7f15995d0e5bd00370a9ba8 SHA512 74a238573f9f911e9a39885b52d8c908d51d5620e346b8927c161111ce193566c315999f71d3edb1cb1326970985fd73d533b5483afe0c98ad76798a3c15e242
DIST fakeredis-1.6.0.gh.tar.gz 70034 BLAKE2B 3e9526bf8a7bdafe2b471f0a9d488f0d654e93666863513444521eefd0ca31dbba7e589431b5dee64b27dbf9c2bcc05c1517f659942aa4491cae42b1d11f45b9 SHA512 7a3aefc161b2396e748b284152e088fc31a49a859259888cf8dcfd3a72045e84079977b0e8f11b571ab00d6c00fcf82dc28a1a50fa75633cf17215553bbd019b
+DIST fakeredis-1.6.1.gh.tar.gz 70171 BLAKE2B f10ac8aaec73871153ac7557a40984e6752b7e3720c1890380bda4aad828003403b6207c5e4f4ace18814e6ad33355acca08ff53cc33cb43acb5d9955ea6e5fc SHA512 1a8718d277d15a887901ed29691af83a2aea57605edf8cf2dbdc00c397a62ea8c1ed21440adadcda431a8ae8f33c85b549c5458a958b1fb74996e54ab612cd13
diff --git a/dev-python/fakeredis/fakeredis-1.6.1.ebuild b/dev-python/fakeredis/fakeredis-1.6.1.ebuild
new file mode 100644
index 000000000000..d1542e220ebf
--- /dev/null
+++ b/dev-python/fakeredis/fakeredis-1.6.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( pypy3 python3_{8..10} )
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Fake implementation of redis API for testing purposes"
+HOMEPAGE="
+ https://github.com/jamesls/fakeredis/
+ https://pypi.org/project/fakeredis/"
+SRC_URI="
+ https://github.com/jamesls/fakeredis/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND="
+ dev-python/redis-py[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/sortedcontainers[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ dev-db/redis
+ dev-python/aioredis[${PYTHON_USEDEP}]
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ dev-python/pytest-mock[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+EPYTEST_DESELECT=(
+ test/test_aioredis2.py::test_blocking_unblock
+ test/test_aioredis2.py::test_pubsub
+ "test/test_aioredis2.py::test_repr[fake]"
+ test/test_hypothesis.py::TestJoint::test
+ test/test_hypothesis.py::TestFuzz::test
+)
+
+python_test() {
+ 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
+ local redis_test_config="
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1
+ "
+
+ einfo "Spawning Redis"
+ einfo "NOTE: Port ${redis_port} must be free"
+ "${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}
+
+pkg_postinst() {
+ optfeature "Mock aioredis" dev-python/aioredis
+}