Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/django-redis/
Date: Mon, 23 Aug 2021 13:51:52
Message-Id: 1629726666.e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5.arthurzam@gentoo
1 commit: e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 23 13:38:49 2021 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 23 13:51:06 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e01c5f0e
7
8 dev-python/django-redis: add 5.0.0, enable py3.{9,10}, EAPI=8, add tests
9
10 Closes: https://bugs.gentoo.org/718728
11 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
12
13 dev-python/django-redis/Manifest | 1 +
14 dev-python/django-redis/django-redis-5.0.0.ebuild | 73 +++++++++++++++++++++++
15 2 files changed, 74 insertions(+)
16
17 diff --git a/dev-python/django-redis/Manifest b/dev-python/django-redis/Manifest
18 index 57ff3e1cacd..d425e911bd9 100644
19 --- a/dev-python/django-redis/Manifest
20 +++ b/dev-python/django-redis/Manifest
21 @@ -1 +1,2 @@
22 DIST django-redis-4.10.0.tar.gz 59208 BLAKE2B 76a6887fdcce7decaeb2c4b76ff0ff58b8b074e902f6ccfc57dbdd21aeac82fbe37367caaf0af1c6facd5b87db6bb053b2fc553ba87b3cca970f2c0b1f99e35c SHA512 39e2d72699ceb2b0887e7048db22a4067001fb5e2c10ae2c5d2d8a0ab71e862773e443ba3a109f7b874b994a842e89772b3e33152aafd2a98e1cd906d5d2e690
23 +DIST django-redis-5.0.0.tar.gz 47508 BLAKE2B 67d87bcbde16730abd71945fe081d425c1047962ff2ca0c382f65d0588ef72103204f8febfeeda9ea382cf53a5c871c087a85ea817f04fac383961f69324557f SHA512 4516e30122845b49789f04fd079b5bc99a732e814d82deb817f14d105895069defa627f1852ce3fd8464de313a5f01ba81f87272f7a98830f7100dbb0c0bfb12
24
25 diff --git a/dev-python/django-redis/django-redis-5.0.0.ebuild b/dev-python/django-redis/django-redis-5.0.0.ebuild
26 new file mode 100644
27 index 00000000000..e7e938e20d1
28 --- /dev/null
29 +++ b/dev-python/django-redis/django-redis-5.0.0.ebuild
30 @@ -0,0 +1,73 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +inherit distutils-r1
38 +
39 +DESCRIPTION="Full featured redis cache backend for Django"
40 +HOMEPAGE="https://github.com/jazzband/django-redis/"
41 +SRC_URI="mirror://pypi/${PN:0:1}"/${PN}/${P}.tar.gz
42 +
43 +LICENSE="BSD"
44 +SLOT="0"
45 +KEYWORDS="~amd64"
46 +
47 +RDEPEND="
48 + >=dev-python/django-2.2[${PYTHON_USEDEP}]
49 + >=dev-python/redis-py-3.0.0[${PYTHON_USEDEP}]
50 +"
51 +BDEPEND="
52 + test? (
53 + dev-db/redis
54 + dev-python/lz4[${PYTHON_USEDEP}]
55 + dev-python/msgpack[${PYTHON_USEDEP}]
56 + dev-python/pytest-django[${PYTHON_USEDEP}]
57 + )
58 +"
59 +
60 +distutils_enable_tests pytest
61 +
62 +src_prepare() {
63 + sed -e '/--cov/d' -e '/--no-cov/d' -i setup.cfg || die
64 + distutils-r1_src_prepare
65 +}
66 +
67 +python_test() {
68 + cd tests || die
69 + local setting_file settings=(
70 + settings.sqlite
71 + settings.sqlite_json
72 + settings.sqlite_lz4
73 + settings.sqlite_msgpack
74 + settings.sqlite_sharding
75 + settings.sqlite_zlib
76 + )
77 + for setting_file in "${settings[@]}"; do
78 + einfo "Testing ${setting_file} configuration"
79 + epytest "--ds=${setting_file}"
80 + done
81 +}
82 +
83 +src_test() {
84 + local redis_pid="${T}"/redis.pid
85 + local redis_port=6379
86 + local redis_test_config="
87 + daemonize yes
88 + pidfile ${redis_pid}
89 + port ${redis_port}
90 + bind 127.0.0.1
91 + "
92 +
93 + # Spawn Redis itself for testing purposes
94 + einfo "Spawning Redis"
95 + einfo "NOTE: Port ${redis_port} must be free"
96 + "${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die
97 +
98 + # Run the tests
99 + distutils-r1_src_test
100 +
101 + # Clean up afterwards
102 + kill "$(<"${redis_pid}")" || die
103 +}