diff mbox series

[meta-python,14/14] python3-yappi: upgrade 1.7.6 -> 1.7.7

Message ID 20261125080732.2419614-75-khem.raj@oss.qualcomm.com
State New
Headers show
Series None | expand

Commit Message

Khem Raj Nov. 25, 2026, 8:07 a.m. UTC
1.7.7 is tagged and released on GitHub but was never uploaded to PyPI,
so fetch the v1.7.7 tag from git instead of the PyPI sdist, and check
for new versions against the git tags.

Refresh the Python 3.15 coroutine fix to the version submitted upstream,
which also switches the guards to PY_VERSION_HEX.

Changes in 1.7.7:
- Fix a reference leak of the generator returned by PyFrame_GetGenerator
  in IS_SUSPENDED (#217)
- Add a regression test for it

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...-coroutines-on-Python-3.15-and-newer.patch | 42 +++++++++++--------
 ...-yappi_1.7.6.bb => python3-yappi_1.7.7.bb} |  9 ++--
 2 files changed, 30 insertions(+), 21 deletions(-)
 rename meta-python/recipes-devtools/python/{python3-yappi_1.7.6.bb => python3-yappi_1.7.7.bb} (69%)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-yappi/0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch b/meta-python/recipes-devtools/python/python3-yappi/0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch
index 748cadbbe4..af8a3d40c8 100644
--- a/meta-python/recipes-devtools/python/python3-yappi/0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch
+++ b/meta-python/recipes-devtools/python/python3-yappi/0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch
@@ -1,36 +1,44 @@ 
-From 99e422d5bcf9edff8427f9ccb5476ffec64c3348 Mon Sep 17 00:00:00 2001
+From fd1c436878b1ce7743ca921fd0cc3e52ef829859 Mon Sep 17 00:00:00 2001
 From: Khem Raj <khem.raj@oss.qualcomm.com>
-Date: Tue, 24 Nov 2026 12:39:11 -0800
-Subject: [PATCH] Detect suspended coroutines on Python 3.15 and newer
+Date: Tue, 24 Nov 2026 22:09:38 -0800
+Subject: [PATCH] fix: detect suspended coroutines on Python 3.15+
 
 IS_SUSPENDED() checks the current instruction for YIELD_VALUE only when
-PY_MINOR_VERSION is 14. On 3.15 it falls back to the gi_frame_state
-check meant for Python < 3.13, which does not detect the suspension, so
-every resume of a coroutine counts as a new call and the asyncio tests
-fail, e.g.:
+the minor version is exactly 14. On Python 3.15 it falls through to the
+gi_frame_state check meant for Python < 3.13, which never reports the
+frame as suspended, so every resume of a coroutine is counted as a new
+call and the asyncio tests fail, e.g.:
 
-  test_asyncio.py::SingleThreadTests::test_issue58
+  test_asyncio.SingleThreadTests.test_issue58
   AssertionError: 2 != 4 : async_sleep 2 0 4.005451 2.002725
 
-Use the instruction check for 3.14 and later.
+Use the instruction check for 3.14 and later, and switch these guards
+to PY_VERSION_HEX like the rest of the file.
 
-Upstream-Status: Pending
+Tested with Python 3.15.2 (test_asyncio and test_asyncio_context_vars
+went from 6 failures to passing) and Python 3.14.
+
+Upstream-Status: Submitted [https://github.com/sumerc/yappi/pull/223]
 AI-Generated: Uses Claude Code
 Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
 ---
- yappi/_yappi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ yappi/_yappi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/yappi/_yappi.c b/yappi/_yappi.c
-index 8b867ef..ffd9e68 100644
+index 1dbb72e..e599c9e 100644
 --- a/yappi/_yappi.c
 +++ b/yappi/_yappi.c
-@@ -228,7 +228,7 @@ IS_SUSPENDED(PyFrameObject *frame) {
+@@ -229,10 +229,10 @@ IS_SUSPENDED(PyFrameObject *frame) {
      if (gen == NULL) {
          return 0;
      }
 -#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 14
-+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 14
++#if PY_VERSION_HEX >= 0x030E0000  // Python 3.14+
      unsigned char curr_op_code = (*frame->f_frame->instr_ptr).op.code;
-     return curr_op_code == YIELD_VALUE || curr_op_code == INSTRUMENTED_YIELD_VALUE;
- #elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 13
+     suspended = curr_op_code == YIELD_VALUE || curr_op_code == INSTRUMENTED_YIELD_VALUE;
+-#elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 13
++#elif PY_VERSION_HEX >= 0x030D0000  // Python 3.13
+     suspended = FRAME_STATE_SUSPENDED(gen->gi_frame_state);
+ #else
+     suspended = gen->gi_frame_state == FRAME_SUSPENDED;
diff --git a/meta-python/recipes-devtools/python/python3-yappi_1.7.6.bb b/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb
similarity index 69%
rename from meta-python/recipes-devtools/python/python3-yappi_1.7.6.bb
rename to meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb
index be47e4ea40..9a0a38b9bc 100644
--- a/meta-python/recipes-devtools/python/python3-yappi_1.7.6.bb
+++ b/meta-python/recipes-devtools/python/python3-yappi_1.7.7.bb
@@ -4,14 +4,15 @@  HOMEPAGE = "https://github.com/sumerc/yappi"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=71c208c9a4fd864385eb69ad4caa3bee"
 
-SRC_URI[sha256sum] = "c94281936af77c00c6ac2306a0e7f85a67e354d717120df85fcc5dfb9243d4dd"
-
-SRC_URI += " \
+# 1.7.7 is tagged on GitHub but was never uploaded to PyPI
+SRC_URI = "git://github.com/sumerc/yappi.git;protocol=https;branch=master;tag=v${PV} \
            file://0002-Fix-import-of-tests.utils-to-enable-pytest.patch \
            file://0003-Detect-suspended-coroutines-on-Python-3.15-and-newer.patch \
            "
+SRCREV = "d6593ea0bce0a13c65bd44511c3cee858b5985e8"
+UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$"
 
-inherit pypi python_setuptools_build_meta ptest-python-pytest
+inherit python_setuptools_build_meta ptest-python-pytest
 
 RDEPENDS:${PN} += "\
     python3-datetime \