Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/fakeredis/
Date: Thu, 01 Dec 2022 07:09:24
Message-Id: 1669878546.8f205a24aef1ebbdb645d05e958ee1ad67d0dcdf.mgorny@gentoo
1 commit: 8f205a24aef1ebbdb645d05e958ee1ad67d0dcdf
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 06:01:07 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 07:09:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f205a24
7
8 dev-python/fakeredis: Bump to 2.1.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/fakeredis/Manifest | 1 +
13 dev-python/fakeredis/fakeredis-2.1.0.ebuild | 87 +++++++++++++++++++++++++++++
14 2 files changed, 88 insertions(+)
15
16 diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
17 index 9b31069cb06d..034a6f901a78 100644
18 --- a/dev-python/fakeredis/Manifest
19 +++ b/dev-python/fakeredis/Manifest
20 @@ -1,2 +1,3 @@
21 DIST fakeredis-py-1.10.1.gh.tar.gz 91420 BLAKE2B a88711b5d167aafcf6a74dc538b809a0410c60bff95c82fe81c1236b743d9fc0cacbc9057bcd5df20ed87b22c12b2e9346342e0991556caa51f4e88038fabcb5 SHA512 2a139dde02c00e516959173fbfe5ecae26d20ee56158de9ae7bc57360dabc58e4e919f11ba7979079019d981af8a2cbd17a1d8ac795003e26a7cbcbedd5588a8
22 DIST fakeredis-py-2.0.0.gh.tar.gz 112218 BLAKE2B 9bbbf76e6fe00a42d25c1688654906a71b93e65a20f3eca2b7d9fd13eedd48251e832e550b37dc82dcf5e65c686c408b291ba60d04c707df7d7d7f396f00190a SHA512 e291782f27cdfa11520eef3b0bbd0d68ec7479a4630ad1e5a38d8d1d28109049fee0288e104e74f72caf9b04db553cc24f22843bd170d8bdb5efc47b8e9f5d6e
23 +DIST fakeredis-py-2.1.0.gh.tar.gz 128595 BLAKE2B f0b2e8ed9ec4156702f4e65e683f40cf79e1fde12ac70b16388ba65e9e49c8f4c92ade6f02195cc3755768fb2858d7e4f8970f54fa728c9fb32ac8cc2f68fa4f SHA512 584a2a36185674d0fadedcc6018286c3edc8c36de730ac1cf09abcbe3b0cacf8dd0e4c964a7a0a053509dce0063f48ce13f122d230fbec9965af54c77b277ea5
24
25 diff --git a/dev-python/fakeredis/fakeredis-2.1.0.ebuild b/dev-python/fakeredis/fakeredis-2.1.0.ebuild
26 new file mode 100644
27 index 000000000000..a75d02ef0771
28 --- /dev/null
29 +++ b/dev-python/fakeredis/fakeredis-2.1.0.ebuild
30 @@ -0,0 +1,87 @@
31 +# Copyright 2020-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +DISTUTILS_USE_PEP517=poetry
37 +PYTHON_COMPAT=( pypy3 python3_{8..11} )
38 +
39 +inherit distutils-r1
40 +
41 +MY_P=fakeredis-py-${PV}
42 +DESCRIPTION="Fake implementation of redis API for testing purposes"
43 +HOMEPAGE="
44 + https://github.com/cunla/fakeredis-py/
45 + https://pypi.org/project/fakeredis/
46 +"
47 +SRC_URI="
48 + https://github.com/cunla/fakeredis-py/archive/v${PV}.tar.gz
49 + -> ${MY_P}.gh.tar.gz
50 +"
51 +S=${WORKDIR}/${MY_P}
52 +
53 +LICENSE="BSD"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
56 +
57 +RDEPEND="
58 + >=dev-python/redis-py-4.2[${PYTHON_USEDEP}]
59 + <dev-python/redis-py-4.5[${PYTHON_USEDEP}]
60 + >=dev-python/sortedcontainers-2.4.0[${PYTHON_USEDEP}]
61 +"
62 +BDEPEND="
63 + test? (
64 + dev-db/redis
65 + dev-python/pytest-asyncio[${PYTHON_USEDEP}]
66 + dev-python/pytest-mock[${PYTHON_USEDEP}]
67 + )
68 +"
69 +
70 +distutils_enable_tests pytest
71 +
72 +src_prepare() {
73 + # unpin redis
74 + sed -i -e '/redis/s:<[0-9.]*:*:' pyproject.toml || die
75 + distutils-r1_src_prepare
76 +}
77 +
78 +python_test() {
79 + local EPYTEST_DESELECT=(
80 + # also lupa
81 + test/test_aioredis2.py::test_failed_script_error
82 + # TODO
83 + "test/test_fakeredis.py::test_set_get_nx[StrictRedis]"
84 + "test/test_fakeredis.py::test_lpop_count[StrictRedis]"
85 + "test/test_fakeredis.py::test_rpop_count[StrictRedis]"
86 + "test/test_fakeredis.py::test_zadd_minus_zero[StrictRedis]"
87 + )
88 + local EPYTEST_IGNORE=(
89 + # these tests fail a lot...
90 + test/test_hypothesis.py
91 + )
92 + local args=(
93 + # tests requiring lupa (lua support)
94 + -k 'not test_eval and not test_lua and not test_script'
95 + )
96 + epytest "${args[@]}"
97 +}
98 +
99 +src_test() {
100 + local redis_pid="${T}"/redis.pid
101 + local redis_port=6379
102 +
103 + einfo "Spawning Redis"
104 + einfo "NOTE: Port ${redis_port} must be free"
105 + "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start redis server"
106 + daemonize yes
107 + pidfile ${redis_pid}
108 + port ${redis_port}
109 + bind 127.0.0.1
110 + EOF
111 +
112 + # Run the tests
113 + distutils-r1_src_test
114 +
115 + # Clean up afterwards
116 + kill "$(<"${redis_pid}")" || die
117 +}