diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2021-08-23 16:38:49 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2021-08-23 16:51:06 +0300 |
commit | e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5 (patch) | |
tree | 60431da72d8a23d741841ba38fbe40301d9f4802 /dev-python/django-redis | |
parent | sci-physics/geant: fix build with CMake 3.20 and above (diff) | |
download | gentoo-e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5.tar.gz gentoo-e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5.tar.bz2 gentoo-e01c5f0e46aa7f1acf7a1e7bf70b699fec6bc7b5.zip |
dev-python/django-redis: add 5.0.0, enable py3.{9,10}, EAPI=8, add tests
Closes: https://bugs.gentoo.org/718728
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/django-redis')
-rw-r--r-- | dev-python/django-redis/Manifest | 1 | ||||
-rw-r--r-- | dev-python/django-redis/django-redis-5.0.0.ebuild | 73 |
2 files changed, 74 insertions, 0 deletions
diff --git a/dev-python/django-redis/Manifest b/dev-python/django-redis/Manifest index 57ff3e1cacd6..d425e911bd9f 100644 --- a/dev-python/django-redis/Manifest +++ b/dev-python/django-redis/Manifest @@ -1 +1,2 @@ DIST django-redis-4.10.0.tar.gz 59208 BLAKE2B 76a6887fdcce7decaeb2c4b76ff0ff58b8b074e902f6ccfc57dbdd21aeac82fbe37367caaf0af1c6facd5b87db6bb053b2fc553ba87b3cca970f2c0b1f99e35c SHA512 39e2d72699ceb2b0887e7048db22a4067001fb5e2c10ae2c5d2d8a0ab71e862773e443ba3a109f7b874b994a842e89772b3e33152aafd2a98e1cd906d5d2e690 +DIST django-redis-5.0.0.tar.gz 47508 BLAKE2B 67d87bcbde16730abd71945fe081d425c1047962ff2ca0c382f65d0588ef72103204f8febfeeda9ea382cf53a5c871c087a85ea817f04fac383961f69324557f SHA512 4516e30122845b49789f04fd079b5bc99a732e814d82deb817f14d105895069defa627f1852ce3fd8464de313a5f01ba81f87272f7a98830f7100dbb0c0bfb12 diff --git a/dev-python/django-redis/django-redis-5.0.0.ebuild b/dev-python/django-redis/django-redis-5.0.0.ebuild new file mode 100644 index 000000000000..e7e938e20d1d --- /dev/null +++ b/dev-python/django-redis/django-redis-5.0.0.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +inherit distutils-r1 + +DESCRIPTION="Full featured redis cache backend for Django" +HOMEPAGE="https://github.com/jazzband/django-redis/" +SRC_URI="mirror://pypi/${PN:0:1}"/${PN}/${P}.tar.gz + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + >=dev-python/django-2.2[${PYTHON_USEDEP}] + >=dev-python/redis-py-3.0.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-db/redis + dev-python/lz4[${PYTHON_USEDEP}] + dev-python/msgpack[${PYTHON_USEDEP}] + dev-python/pytest-django[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_prepare() { + sed -e '/--cov/d' -e '/--no-cov/d' -i setup.cfg || die + distutils-r1_src_prepare +} + +python_test() { + cd tests || die + local setting_file settings=( + settings.sqlite + settings.sqlite_json + settings.sqlite_lz4 + settings.sqlite_msgpack + settings.sqlite_sharding + settings.sqlite_zlib + ) + for setting_file in "${settings[@]}"; do + einfo "Testing ${setting_file} configuration" + epytest "--ds=${setting_file}" + done +} + +src_test() { + local redis_pid="${T}"/redis.pid + local redis_port=6379 + local redis_test_config=" + daemonize yes + pidfile ${redis_pid} + port ${redis_port} + bind 127.0.0.1 + " + + # Spawn Redis itself for testing purposes + einfo "Spawning Redis" + einfo "NOTE: Port ${redis_port} must be free" + "${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die + + # Run the tests + distutils-r1_src_test + + # Clean up afterwards + kill "$(<"${redis_pid}")" || die +} |