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: Wed, 28 Sep 2022 18:34:32
Message-Id: 1664389982.7fb5657acbd84f3c3e3160edb069875322877eb2.mgorny@gentoo
1 commit: 7fb5657acbd84f3c3e3160edb069875322877eb2
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 28 18:15:26 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 28 18:33:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fb5657a
7
8 dev-python/fakeredis: Bump to 1.9.3
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/fakeredis/Manifest | 1 +
13 dev-python/fakeredis/fakeredis-1.9.3.ebuild | 87 +++++++++++++++++++++++++++++
14 2 files changed, 88 insertions(+)
15
16 diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
17 index 0dc4acf0459c..0b790f4fb0c9 100644
18 --- a/dev-python/fakeredis/Manifest
19 +++ b/dev-python/fakeredis/Manifest
20 @@ -1,2 +1,3 @@
21 DIST fakeredis-py-1.9.1.gh.tar.gz 86742 BLAKE2B aa3f0b05f486219cb6eb560f561ab3e39cc32286cdc3f4f9aba667e256528b9338dcc03f3ddb00c0db30ddb181afe535e209f6ee0e98c56a0cad445e2181ec67 SHA512 27b4c95e596fdd69cecc737897edfedd6f55e7c5610394b1532e4b2aededaed6ad15763582ce6cc20821ac7ea096f60204f7080d247359d8e8d0d360a61c8e39
22 DIST fakeredis-py-1.9.2.gh.tar.gz 87038 BLAKE2B 89ae3059d58fc9649979b787339a98eaedccd2b29814090e1bf0cb2c54836ed722d829b9965d3d0a92ff4d8ee714f6a455b85f68b383a5ba6a67aefd20f70410 SHA512 6a4d90c0c327787b7505542a3615f383735bffb021cbfc0a2adf2cfb87326c517d67c1df2f318cd84b60b8d0f1dcb20faea05529a856bf81b0f3ae6cc16823ed
23 +DIST fakeredis-py-1.9.3.gh.tar.gz 87068 BLAKE2B ee657bd0b04f5701c9e6445ca646fcc510dc3235407372fec9891f7d1adc5cacbd7a52e2d520c930f53491c2a18f5578d1b5186337953439f93fbb69a5e65ef8 SHA512 5255a75bae15ac325a41a273c70a467c8622d5992d40967e4ac21920c0563dbad808e9b82af203e72e3404f74a7bbfd2c12f5d854f9d353defec5b0333843266
24
25 diff --git a/dev-python/fakeredis/fakeredis-1.9.3.ebuild b/dev-python/fakeredis/fakeredis-1.9.3.ebuild
26 new file mode 100644
27 index 000000000000..315d3ed64771
28 --- /dev/null
29 +++ b/dev-python/fakeredis/fakeredis-1.9.3.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.4[${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 +}