Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/redis-py/
Date: Sun, 02 Aug 2020 20:23:02
Message-Id: 1596399771.0b273e55483ad569b59aec58332f4e41168f3ef4.sam@gentoo
1 commit: 0b273e55483ad569b59aec58332f4e41168f3ef4
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 2 20:22:51 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 2 20:22:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b273e55
7
8 dev-python/redis-py: bump to 3.5.3
9
10 Changes:
11 * bump to 3.5.3
12 * modernise test running; eliminates warning on running tests
13 (method was to be removed upstream)
14
15 Package-Manager: Portage-3.0.1, Repoman-2.3.23
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 dev-python/redis-py/Manifest | 1 +
19 dev-python/redis-py/redis-py-3.5.3.ebuild | 77 +++++++++++++++++++++++++++++++
20 2 files changed, 78 insertions(+)
21
22 diff --git a/dev-python/redis-py/Manifest b/dev-python/redis-py/Manifest
23 index 61bdd72bbbd..d371b403131 100644
24 --- a/dev-python/redis-py/Manifest
25 +++ b/dev-python/redis-py/Manifest
26 @@ -1 +1,2 @@
27 DIST redis-py-3.3.11.tar.gz 131072 BLAKE2B 6becafba3da22bae796a4a9ba55d11a61d9ed1a8b693a734d4ef3f0e463c0c39a05c01546225f69eb36a788779d6e45d0136e1a6d6856ec63c3dd07994b5db9a SHA512 a32327fcebc6242367c0eda6c6dcd1a15d5d575527af2e9de0d76e05bc4afc7402566d9254e467663b81907a310731af3041236b6b135f3b8ff1429a502c1000
28 +DIST redis-py-3.5.3.tar.gz 141112 BLAKE2B b953d553a3cfa2d6ba6f5aa35dfaf93865acbfad0e901a96082c3b1c027dc23b6ceedde185f24e86772522fbbf4f0a4d18e115a6b40aff6a65450bbe397d5c07 SHA512 eae6ac6b3e0f1366a9c29e5e2d9a5210e4627e62e3006159b1c290f36cd9c1c2c12cafe0944f7a010e04632b517874f230aa9411491993b7ecf2080546217206
29
30 diff --git a/dev-python/redis-py/redis-py-3.5.3.ebuild b/dev-python/redis-py/redis-py-3.5.3.ebuild
31 new file mode 100644
32 index 00000000000..bd958cbad2e
33 --- /dev/null
34 +++ b/dev-python/redis-py/redis-py-3.5.3.ebuild
35 @@ -0,0 +1,77 @@
36 +# Copyright 1999-2020 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
42 +
43 +inherit distutils-r1
44 +
45 +MY_PN="redis"
46 +MY_P="${MY_PN}-${PV}"
47 +
48 +DESCRIPTION="Python client for Redis key-value store"
49 +HOMEPAGE="https://github.com/andymccurdy/redis-py"
50 +SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
51 +
52 +LICENSE="MIT"
53 +SLOT="0"
54 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
55 +IUSE="test"
56 +RESTRICT="!test? ( test )"
57 +
58 +DEPEND="
59 + test? (
60 + dev-db/redis
61 + dev-python/mock[${PYTHON_USEDEP}]
62 + )
63 +"
64 +
65 +S="${WORKDIR}/${MY_P}"
66 +
67 +python_prepare_all() {
68 + distutils-r1_python_prepare_all
69 +
70 + # Make sure that tests will be used from BUILD_DIR rather than cwd.
71 + mv tests tests-hidden || die
72 +
73 + # Correct local import patch syntax
74 + sed \
75 + -e 's:from .conftest:from conftest:' \
76 + -e 's:from .test_pubsub:from test_pubsub:' \
77 + -i tests-hidden/test_*.py \
78 + || die
79 +}
80 +
81 +python_compile() {
82 + distutils-r1_python_compile
83 +
84 + if use test; then
85 + cp -r tests-hidden "${BUILD_DIR}"/tests || die
86 + fi
87 +}
88 +
89 +src_test() {
90 + local redis_pid="${T}"/redis.pid
91 + local redis_port=6379
92 + local redis_test_config="daemonize yes
93 + pidfile ${redis_pid}
94 + port ${redis_port}
95 + bind 127.0.0.1
96 + "
97 +
98 + # Spawn Redis itself for testing purposes
99 + # NOTE: On sam@'s machine, spawning Redis can hang in the sandbox.
100 + # I'm not restricting tests yet because this doesn't happen for anyone else AFAICT.
101 + elog "Spawning Redis"
102 + elog "NOTE: Port ${redis_port} must be free"
103 + /usr/sbin/redis-server - <<< "${redis_test_config}" || die
104 +
105 + # Run the tests
106 + distutils-r1_src_test
107 +
108 + # Clean up afterwards
109 + kill "$(<"${redis_pid}")" || die
110 +}
111 +
112 +distutils_enable_tests pytest