summaryrefslogtreecommitdiff
path: root/dev-python/txredisapi
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/txredisapi')
-rw-r--r--dev-python/txredisapi/Manifest2
-rw-r--r--dev-python/txredisapi/files/txredisapi-1.4.11-multiple-colons.patch35
-rw-r--r--dev-python/txredisapi/metadata.xml10
-rw-r--r--dev-python/txredisapi/txredisapi-1.4.11-r1.ebuild89
-rw-r--r--dev-python/txredisapi/txredisapi-1.4.12.ebuild85
5 files changed, 221 insertions, 0 deletions
diff --git a/dev-python/txredisapi/Manifest b/dev-python/txredisapi/Manifest
new file mode 100644
index 000000000000..19463bbbbc12
--- /dev/null
+++ b/dev-python/txredisapi/Manifest
@@ -0,0 +1,2 @@
+DIST txredisapi-1.4.11.gh.tar.gz 54559 BLAKE2B acc18f1db84043869ac1e52393654219f20c72e1492773015e4eac2ffc6289d3267852e3cf928e87218bae79118610df488cfe7f543ba7e531f90e96fc3dc79d SHA512 f48f9f702136b7b37d9841692f32cf917ec9577cb52b76240e27723b2e53e7a70ecdc4d28ccd7daa22e7ab61214edc4d58856f6c4c17e35939166ad0a553491e
+DIST txredisapi-1.4.12.gh.tar.gz 55552 BLAKE2B 48f5060a75464873d464ff9900dc539ffd470867ef71f2c35863caada3f957dec388d6f340b01fd47026bf954e46dbc162103e3d5c4ff5693a0264fb8d7cdccc SHA512 71903954b3d3cdc82e020a094538ccae5dfc2676b042dd115b6e8a1e00c33ddb07cf1d2a1df81db563165ea327c53e1a22ae4acb09d6717612154fbc5f74e450
diff --git a/dev-python/txredisapi/files/txredisapi-1.4.11-multiple-colons.patch b/dev-python/txredisapi/files/txredisapi-1.4.11-multiple-colons.patch
new file mode 100644
index 000000000000..1dd05fd998d6
--- /dev/null
+++ b/dev-python/txredisapi/files/txredisapi-1.4.11-multiple-colons.patch
@@ -0,0 +1,35 @@
+From 3c8f36c263b7b6574e69422b50c9a900efc5ef7f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@gentoo.org>
+Date: Wed, 8 Oct 2025 15:33:27 +0200
+Subject: [PATCH] Fix INFO command parsing for lines with multiple colons
+
+This commit resolves an issue with parsing the INFO command output when
+lines contain multiple `:` characters, such as those with IPv6
+addresses:
+
+ listener0:name=tcp,bind=127.0.0.1,bind=::1,port=6379
+
+Such a line can appear there since the Redis version 7.2.0. Listneres
+info was introdcued commit 0c4d2fcc8eff ("Add listeners info string for
+'INFO' command").
+
+The fix is simple, the split() method in _process_info() is restricted
+to perform the split only on the first `:` character.
+
+Fixes: https://github.com/IlyaSkriblovsky/txredisapi/issues/151
+Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
+Upstream-PR: https://github.com/IlyaSkriblovsky/txredisapi/pull/157
+
+diff --git a/txredisapi.py b/txredisapi.py
+index b02a78e..2f1875d 100644
+--- a/txredisapi.py
++++ b/txredisapi.py
+@@ -1685,7 +1685,7 @@ def _process_info(self, r):
+ ':' in x and not x.startswith('#')]
+ d = {}
+ for kv in keypairs:
+- k, v = kv.split(':')
++ k, v = kv.split(':', 1)
+ d[k] = v
+ return d
+
diff --git a/dev-python/txredisapi/metadata.xml b/dev-python/txredisapi/metadata.xml
new file mode 100644
index 000000000000..c69681175a83
--- /dev/null
+++ b/dev-python/txredisapi/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>arkamar@gentoo.org</email>
+ <name>Petr Vaněk</name>
+ </maintainer>
+ <stabilize-allarches />
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-python/txredisapi/txredisapi-1.4.11-r1.ebuild b/dev-python/txredisapi/txredisapi-1.4.11-r1.ebuild
new file mode 100644
index 000000000000..9970d25eed73
--- /dev/null
+++ b/dev-python/txredisapi/txredisapi-1.4.11-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Non-blocking redis client for python"
+HOMEPAGE="
+ https://github.com/IlyaSkriblovsky/txredisapi/
+ https://pypi.org/project/txredisapi/
+"
+# Github is used because PyPI archive does not contain tests,
+# see https://github.com/IlyaSkriblovsky/txredisapi/issues/149
+SRC_URI="
+ https://github.com/IlyaSkriblovsky/${PN}/archive/refs/tags/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 ~ppc64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/twisted[${PYTHON_USEDEP},ssl(-)]
+"
+BDEPEND="
+ test? (
+ ${RDEPEND}
+ dev-db/redis
+ dev-python/hiredis[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-multiple-colons.patch
+)
+
+src_prepare() {
+ sed -i "/redis_sock =/s:/tmp:${T}:" tests/test_unix_connection.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ # paralellized tests with -j parameter fail
+ "${EPYTHON}" -m twisted.trial tests || die "tests failed with ${EPYTHON}"
+}
+
+src_test() {
+ local redis_pid="${T}"/redis.pid
+ local redis_port=6379
+
+ if has_version ">=dev-db/redis-7"; then
+ local extra_conf="
+ enable-debug-command yes
+ enable-module-command yes
+ "
+ fi
+
+ # Spawn Redis itself for testing purposes
+ einfo "Spawning Redis"
+ einfo "NOTE: Port ${redis_port} must be free"
+ "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start redis server"
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1 ::1
+ unixsocket ${T}/redis.sock
+ unixsocketperm 700
+ ${extra_conf}
+ EOF
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}
+
+pkg_postinst() {
+ optfeature "Use hiredis protocol parser" dev-python/hiredis
+}
diff --git a/dev-python/txredisapi/txredisapi-1.4.12.ebuild b/dev-python/txredisapi/txredisapi-1.4.12.ebuild
new file mode 100644
index 000000000000..db10669353ac
--- /dev/null
+++ b/dev-python/txredisapi/txredisapi-1.4.12.ebuild
@@ -0,0 +1,85 @@
+# Copyright 2023-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Non-blocking redis client for python"
+HOMEPAGE="
+ https://github.com/IlyaSkriblovsky/txredisapi/
+ https://pypi.org/project/txredisapi/
+"
+# Github is used because PyPI archive does not contain tests,
+# see https://github.com/IlyaSkriblovsky/txredisapi/issues/149
+SRC_URI="
+ https://github.com/IlyaSkriblovsky/${PN}/archive/refs/tags/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/twisted[${PYTHON_USEDEP},ssl(-)]
+"
+BDEPEND="
+ test? (
+ ${RDEPEND}
+ dev-db/redis
+ dev-python/hiredis[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+
+src_prepare() {
+ sed -i "/redis_sock =/s:/tmp:${T}:" tests/test_unix_connection.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ # paralellized tests with -j parameter fail
+ "${EPYTHON}" -m twisted.trial tests || die "tests failed with ${EPYTHON}"
+}
+
+src_test() {
+ local redis_pid="${T}"/redis.pid
+ local redis_port=6379
+
+ if has_version ">=dev-db/redis-7"; then
+ local extra_conf="
+ enable-debug-command yes
+ enable-module-command yes
+ "
+ fi
+
+ # Spawn Redis itself for testing purposes
+ einfo "Spawning Redis"
+ einfo "NOTE: Port ${redis_port} must be free"
+ "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start redis server"
+ daemonize yes
+ pidfile ${redis_pid}
+ port ${redis_port}
+ bind 127.0.0.1 ::1
+ unixsocket ${T}/redis.sock
+ unixsocketperm 700
+ ${extra_conf}
+ EOF
+
+ # Run the tests
+ distutils-r1_src_test
+
+ # Clean up afterwards
+ kill "$(<"${redis_pid}")" || die
+}
+
+pkg_postinst() {
+ optfeature "Use hiredis protocol parser" dev-python/hiredis
+}