From 91958284124f30d056f111ee345cc4a379d6ebff Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Tue, 22 Apr 2025 09:21:47 -0500 Subject: [PATCH 1/5] Back to development: 3.2.2 --- CHANGES.rst | 6 ++++++ src/greenlet/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 22c204b..0b3fcf4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,12 @@ Changes ========= +3.2.2 (unreleased) +================== + +- Nothing changed yet. + + 3.2.1 (2025-04-22) ================== diff --git a/src/greenlet/__init__.py b/src/greenlet/__init__.py index 3386a09..2ad8a02 100644 --- a/src/greenlet/__init__.py +++ b/src/greenlet/__init__.py @@ -25,7 +25,7 @@ ### # Metadata ### -__version__ = '3.2.1' +__version__ = '3.2.2.dev0' from ._greenlet import _C_API # pylint:disable=no-name-in-module ### From 36626882b0b9afee71cdc63fc40fb0fe19687d53 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 8 May 2025 18:24:01 +0200 Subject: [PATCH 2/5] Update to Python 3.14 beta 1 Beta 1 removed the PyThreadState.c_recursion_remaining member and the Py_C_RECURSION_LIMIT constant. --- src/greenlet/TGreenlet.hpp | 4 +++- src/greenlet/TPythonState.cpp | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/greenlet/TGreenlet.hpp b/src/greenlet/TGreenlet.hpp index 9e917e7..f69b881 100644 --- a/src/greenlet/TGreenlet.hpp +++ b/src/greenlet/TGreenlet.hpp @@ -110,7 +110,9 @@ namespace greenlet _PyCFrame* cframe; int use_tracing; #endif -#if GREENLET_PY312 +#if GREENLET_PY314 + int py_recursion_depth; +#elif GREENLET_PY312 int py_recursion_depth; int c_recursion_depth; #else diff --git a/src/greenlet/TPythonState.cpp b/src/greenlet/TPythonState.cpp index cc5dff5..a7f743c 100644 --- a/src/greenlet/TPythonState.cpp +++ b/src/greenlet/TPythonState.cpp @@ -12,7 +12,9 @@ PythonState::PythonState() ,cframe(nullptr) ,use_tracing(0) #endif -#if GREENLET_PY312 +#if GREENLET_PY314 + ,py_recursion_depth(0) +#elif GREENLET_PY312 ,py_recursion_depth(0) ,c_recursion_depth(0) #else @@ -132,7 +134,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept #endif #endif // GREENLET_USE_CFRAME #if GREENLET_PY311 - #if GREENLET_PY312 + #if GREENLET_PY314 + this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining; + #elif GREENLET_PY312 this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining; this->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining; #else // not 312 @@ -207,7 +211,10 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept #endif #endif // GREENLET_USE_CFRAME #if GREENLET_PY311 - #if GREENLET_PY312 + #if GREENLET_PY314 + tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth; + this->unexpose_frames(); + #elif GREENLET_PY312 tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth; tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this->c_recursion_depth; this->unexpose_frames(); @@ -253,7 +260,9 @@ inline void PythonState::will_switch_from(PyThreadState *const origin_tstate) no void PythonState::set_initial_state(const PyThreadState* const tstate) noexcept { this->_top_frame = nullptr; -#if GREENLET_PY312 +#if GREENLET_PY314 + this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining; +#elif GREENLET_PY312 this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining; // XXX: TODO: Comment from a reviewer: // Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``? From a2f98dc6c74c12acafea476ed124c6a265362350 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 8 May 2025 18:33:45 +0200 Subject: [PATCH 3/5] GitHub Actions: Update to beta1 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9b3e32..110d347 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.7"] + python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-beta.1"] # Recall the macOS builds upload built wheels so all supported versions # need to run on mac. os: [ubuntu-latest, macos-latest] From 19673c720cf71df573a41ad63b6a11962be19441 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Fri, 9 May 2025 09:48:44 -0500 Subject: [PATCH 4/5] Add change note for 3.14b1 --- CHANGES.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 0b3fcf4..59da515 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,9 @@ 3.2.2 (unreleased) ================== -- Nothing changed yet. +- Make greenlet build and run on Python 3.14 beta 1. It will not run + on earlier versions of 3.14; it should run on subsequent versions. + See `PR 445 `_. 3.2.1 (2025-04-22) From 097bca95f66bc052a8680512dc54f8dcaf028496 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Fri, 9 May 2025 09:49:26 -0500 Subject: [PATCH 5/5] Preparing release 3.2.2 --- CHANGES.rst | 2 +- src/greenlet/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 59da515..8e26d59 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,7 +2,7 @@ Changes ========= -3.2.2 (unreleased) +3.2.2 (2025-05-09) ================== - Make greenlet build and run on Python 3.14 beta 1. It will not run diff --git a/src/greenlet/__init__.py b/src/greenlet/__init__.py index 2ad8a02..9483b7c 100644 --- a/src/greenlet/__init__.py +++ b/src/greenlet/__init__.py @@ -25,7 +25,7 @@ ### # Metadata ### -__version__ = '3.2.2.dev0' +__version__ = '3.2.2' from ._greenlet import _C_API # pylint:disable=no-name-in-module ###