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: Sun, 08 May 2022 08:47:37
Message-Id: 1651999630.20bb464e5f04af6288109cb557e56b8481530022.mgorny@gentoo
1 commit: 20bb464e5f04af6288109cb557e56b8481530022
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 8 07:23:22 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun May 8 08:47:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20bb464e
7
8 dev-python/fakeredis: Bump to 1.7.4
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.7.4.ebuild | 93 +++++++++++++++++++++++++++++
14 dev-python/fakeredis/metadata.xml | 2 +-
15 3 files changed, 95 insertions(+), 1 deletion(-)
16
17 diff --git a/dev-python/fakeredis/Manifest b/dev-python/fakeredis/Manifest
18 index 8d025a58b420..d7fc8cbf2524 100644
19 --- a/dev-python/fakeredis/Manifest
20 +++ b/dev-python/fakeredis/Manifest
21 @@ -1 +1,2 @@
22 DIST fakeredis-1.7.1.gh.tar.gz 71151 BLAKE2B 87877c94a4c03ad6ff4b55f307526f712daa860257374a97a8f7bd29440d171467e18e4041ca56bb6af30df30481a3d5b13c7d0657ba3eb7673a653664ffbe8a SHA512 f41d9393ae50bae9de064678948f4364fc47db06f489782e5b428f449828ad5813b08b2fb053bef878b2a1b500edbb0ea1881449dbd12c2b6e385f6a2fba4c59
23 +DIST fakeredis-py-1.7.4.gh.tar.gz 73024 BLAKE2B d3d18611d846a0dabb52d74ca53cad997b37e794ef320bc800ab5339f70710bc30f9e33c0820db941064fbf9dca0dde3e72c78298895b8c2510a93353898b355 SHA512 71c9ffe7c208453bc8f5e719b3647a9b9fc5406c5fe3856ef1dc42c019bd7128355d260be468b62dcb764a918a3510f193fb1aaf374bb3866e352c9c2bae90c6
24
25 diff --git a/dev-python/fakeredis/fakeredis-1.7.4.ebuild b/dev-python/fakeredis/fakeredis-1.7.4.ebuild
26 new file mode 100644
27 index 000000000000..01803254b09c
28 --- /dev/null
29 +++ b/dev-python/fakeredis/fakeredis-1.7.4.ebuild
30 @@ -0,0 +1,93 @@
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=setuptools
37 +PYTHON_COMPAT=( pypy3 python3_{9..10} )
38 +
39 +inherit distutils-r1 optfeature
40 +
41 +MY_P=fakeredis-py-${PV}
42 +DESCRIPTION="Fake implementation of redis API for testing purposes"
43 +HOMEPAGE="
44 + https://github.com/dsoftwareinc/fakeredis-py/
45 + https://pypi.org/project/fakeredis/
46 +"
47 +SRC_URI="
48 + https://github.com/dsoftwareinc/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[${PYTHON_USEDEP}]
59 + dev-python/six[${PYTHON_USEDEP}]
60 + dev-python/sortedcontainers[${PYTHON_USEDEP}]
61 +"
62 +BDEPEND="
63 + test? (
64 + dev-db/redis
65 + dev-python/aioredis[${PYTHON_USEDEP}]
66 + dev-python/pytest-asyncio[${PYTHON_USEDEP}]
67 + dev-python/pytest-mock[${PYTHON_USEDEP}]
68 + )
69 +"
70 +
71 +distutils_enable_tests pytest
72 +
73 +src_prepare() {
74 + # unpin redis
75 + sed -i -e '/redis/s:<=.*::' setup.cfg || die
76 + distutils-r1_src_prepare
77 +}
78 +
79 +python_test() {
80 + local EPYTEST_DESELECT=(
81 + # also lupa
82 + test/test_aioredis2.py::test_failed_script_error
83 + # TODO
84 + "test/test_fakeredis.py::test_set_get_nx[StrictRedis]"
85 + "test/test_fakeredis.py::test_lpop_count[StrictRedis]"
86 + "test/test_fakeredis.py::test_rpop_count[StrictRedis]"
87 + "test/test_fakeredis.py::test_zadd_minus_zero[StrictRedis]"
88 + )
89 + local EPYTEST_IGNORE=(
90 + # these tests fail a lot...
91 + test/test_hypothesis.py
92 + )
93 + local args=(
94 + # tests requiring lupa (lua support)
95 + -k 'not test_eval and not test_lua and not test_script'
96 + )
97 + epytest "${args[@]}"
98 +}
99 +
100 +src_test() {
101 + local redis_pid="${T}"/redis.pid
102 + local redis_port=6379
103 + local redis_test_config="
104 + daemonize yes
105 + pidfile ${redis_pid}
106 + port ${redis_port}
107 + bind 127.0.0.1
108 + "
109 +
110 + einfo "Spawning Redis"
111 + einfo "NOTE: Port ${redis_port} must be free"
112 + "${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die
113 +
114 + # Run the tests
115 + distutils-r1_src_test
116 +
117 + # Clean up afterwards
118 + kill "$(<"${redis_pid}")" || die
119 +}
120 +
121 +pkg_postinst() {
122 + optfeature "Mock aioredis" dev-python/aioredis
123 +}
124
125 diff --git a/dev-python/fakeredis/metadata.xml b/dev-python/fakeredis/metadata.xml
126 index d6b0b74ee354..3d21e4768321 100644
127 --- a/dev-python/fakeredis/metadata.xml
128 +++ b/dev-python/fakeredis/metadata.xml
129 @@ -7,6 +7,6 @@
130 <stabilize-allarches/>
131 <upstream>
132 <remote-id type="pypi">fakeredis</remote-id>
133 - <remote-id type="github">jamesls/fakeredis</remote-id>
134 + <remote-id type="github">dsoftwareinc/fakeredis</remote-id>
135 </upstream>
136 </pkgmetadata>