From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/fakeredis/files/, dev-python/fakeredis/
Date: Sun, 09 Mar 2025 14:58:23 +0000 (UTC) [thread overview]
Message-ID: <1741532300.8e5f051fd9b89514c291456b96e7a5ed553bf162.mgorny@gentoo> (raw)
commit: 8e5f051fd9b89514c291456b96e7a5ed553bf162
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 9 14:46:02 2025 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 9 14:58:20 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e5f051f
dev-python/fakeredis: Enable pypy3.11
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/fakeredis/fakeredis-2.27.0.ebuild | 7 +++++-
.../fakeredis/files/fakeredis-2.27.0-pypy.patch | 29 ++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/dev-python/fakeredis/fakeredis-2.27.0.ebuild b/dev-python/fakeredis/fakeredis-2.27.0.ebuild
index 9eb948a30eb2..1921f6909742 100644
--- a/dev-python/fakeredis/fakeredis-2.27.0.ebuild
+++ b/dev-python/fakeredis/fakeredis-2.27.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=poetry
-PYTHON_COMPAT=( pypy3 python3_{10..13} )
+PYTHON_COMPAT=( pypy3 pypy3_11 python3_{10..13} )
inherit distutils-r1 pypi
@@ -38,6 +38,11 @@ BDEPEND="
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ # https://github.com/cunla/fakeredis-py/pull/363
+ "${FILESDIR}/${P}-pypy.patch"
+ )
+
distutils-r1_src_prepare
# https://github.com/cunla/fakeredis-py/issues/320
diff --git a/dev-python/fakeredis/files/fakeredis-2.27.0-pypy.patch b/dev-python/fakeredis/files/fakeredis-2.27.0-pypy.patch
new file mode 100644
index 000000000000..72871a55f59f
--- /dev/null
+++ b/dev-python/fakeredis/files/fakeredis-2.27.0-pypy.patch
@@ -0,0 +1,29 @@
+From 61fef9d6c144f34654bfaa596678696b0d78d229 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 9 Mar 2025 15:36:45 +0100
+Subject: [PATCH] fix: Fix `test_tcp_server_started` to close the connection
+
+Fix `test_tcp_server_started` to use a context manager, in order to
+close the connection to the `TcpFakeServer` when done. Otherwise,
+the test relies on GC closing the connection in order for the server
+thread to finish -- which does not happen with PyPy, and causes `pytest`
+to hang after running the test suite.
+---
+ test/test_tcp_server/test_connectivity.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/test/test_tcp_server/test_connectivity.py b/test/test_tcp_server/test_connectivity.py
+index 414ed58..9a1f6f1 100644
+--- a/test/test_tcp_server/test_connectivity.py
++++ b/test/test_tcp_server/test_connectivity.py
+@@ -17,7 +17,7 @@ def test_tcp_server_started():
+ t = Thread(target=server.serve_forever, daemon=True)
+ t.start()
+ time.sleep(0.1)
+- r = redis.Redis(host=server_address[0], port=server_address[1])
+- r.set("foo", "bar")
+- assert r.get("foo") == b"bar"
++ with redis.Redis(host=server_address[0], port=server_address[1]) as r:
++ r.set("foo", "bar")
++ assert r.get("foo") == b"bar"
+ server.shutdown()
reply other threads:[~2025-03-09 14:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1741532300.8e5f051fd9b89514c291456b96e7a5ed553bf162.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox