Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-greenlet for openSUSE:Factory 
checked in at 2024-09-12 16:53:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-greenlet (Old)
 and      /work/SRC/openSUSE:Factory/.python-greenlet.new.17570 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-greenlet"

Thu Sep 12 16:53:56 2024 rev:50 rq:1199963 version:3.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-greenlet/python-greenlet.changes  
2024-09-10 21:12:34.316384131 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-greenlet.new.17570/python-greenlet.changes   
    2024-09-12 16:53:56.962842344 +0200
@@ -1,0 +2,14 @@
+Tue Sep 10 20:44:39 UTC 2024 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to 3.1.0
+  * Adds support for Python 3.13.
+  * Greatly reduce the chances for crashes during interpreter shutdown.
+  * Support for the following platforms was contributed by the community.
+    Note that they are untested by this project's continuous integration
+    services.
+    + Hitachi's SuperH CPU
+    + NetBSD on PowerPC
+    + RISC-V with -fno-omit-frame-pointer
+- Drop port-to-python313.patch, merged upstream
+
+-------------------------------------------------------------------

Old:
----
  greenlet-3.0.3.tar.gz
  port-to-python313.patch

New:
----
  greenlet-3.1.0.tar.gz

BETA DEBUG BEGIN:
  Old:    + RISC-V with -fno-omit-frame-pointer
- Drop port-to-python313.patch, merged upstream
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-greenlet.spec ++++++
--- /var/tmp/diff_new_pack.sXV20q/_old  2024-09-12 16:53:57.954883677 +0200
+++ /var/tmp/diff_new_pack.sXV20q/_new  2024-09-12 16:53:57.954883677 +0200
@@ -22,7 +22,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-greenlet
-Version:        3.0.3
+Version:        3.1.0
 Release:        0
 Summary:        Lightweight in-process concurrent programming
 License:        MIT
@@ -30,8 +30,6 @@
 URL:            https://github.com/python-greenlet/greenlet
 Source0:        
https://files.pythonhosted.org/packages/source/g/greenlet/greenlet-%{version}.tar.gz
 Source9:        python-greenlet-rpmlintrc
-# PATCH-FIX-UPSTREAM gh/python-greenlet/greenlet#396 - Port to Python 3.13
-Patch0:         
https://github.com/python-greenlet/greenlet/pull/396.patch#/port-to-python313.patch
 BuildRequires:  %{python_module devel >= 3.7}
 BuildRequires:  %{python_module objgraph}
 BuildRequires:  %{python_module pip}

++++++ greenlet-3.0.3.tar.gz -> greenlet-3.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/.github/dependabot.yml 
new/greenlet-3.1.0/.github/dependabot.yml
--- old/greenlet-3.0.3/.github/dependabot.yml   1970-01-01 01:00:00.000000000 
+0100
+++ new/greenlet-3.1.0/.github/dependabot.yml   2024-09-10 18:50:06.000000000 
+0200
@@ -0,0 +1,13 @@
+# Keep GitHub Actions up to date with GitHub's Dependabot...
+# 
https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
+# 
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
+version: 2
+updates:
+  - package-ecosystem: github-actions
+    directory: /
+    groups:
+      github-actions:
+        patterns:
+          - "*"  # Group all Actions updates into a single larger pull request
+    schedule:
+      interval: monthly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/.github/workflows/tests.yml 
new/greenlet-3.1.0/.github/workflows/tests.yml
--- old/greenlet-3.0.3/.github/workflows/tests.yml      2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/.github/workflows/tests.yml      2024-09-10 
18:50:06.000000000 +0200
@@ -25,16 +25,22 @@
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
-        os: [ubuntu-latest, macos-latest]
+        python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
+        os: [ubuntu-latest]
+        include:
+          - os: macos-latest
+            python-version: 3.12
+          - os: macos-latest
+            python-version: 3.13
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
     - name: Set up Python
-      uses: actions/setup-python@v4
+      uses: actions/setup-python@v5
       with:
         python-version: ${{ matrix.python-version }}
         cache: 'pip'
         cache-dependency-path: setup.py
+        allow-prereleases: true
     - name: Install dependencies
       run: |
         python -m pip install -U pip setuptools wheel
@@ -77,7 +83,7 @@
         ls -l dist
         twine check dist/*
     - name: Store greenlet wheel
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: greenlet-${{ runner.os }}-${{ matrix.python-version }}.whl
         path: dist/*whl
@@ -90,7 +96,7 @@
       run: |
         sphinx-build -b doctest -d docs/_build/doctrees2 docs 
docs/_build/doctest2
     - name: Lint
-      if: matrix.python-version == '3.10' && startsWith(runner.os, 'Linux')
+      if: matrix.python-version == '3.12' && startsWith(runner.os, 'Linux')
       # We only need to do this on one version.
       # We do this here rather than a separate job to avoid the compilation 
overhead.
       run: |
@@ -113,9 +119,9 @@
       # required for all workflows
       security-events: write
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip'
@@ -129,7 +135,7 @@
           echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
       # Initializes the CodeQL tools for scanning.
       - name: Initialize CodeQL
-        uses: github/codeql-action/init@v2
+        uses: github/codeql-action/init@v3
         with:
           languages: python, cpp
           # Override the default behavior so that the action doesn't attempt
@@ -141,7 +147,7 @@
       # - name: Autobuild
       #   uses: github/codeql-action/autobuild@v1
       - name: Perform CodeQL Analysis
-        uses: github/codeql-action/analyze@v2
+        uses: github/codeql-action/analyze@v3
 
   manylinux:
 
@@ -162,13 +168,13 @@
 
     steps:
       - name: checkout
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python-version }}
       - name: Set up QEMU
-        uses: docker/setup-qemu-action@v2
+        uses: docker/setup-qemu-action@v3
         with:
           platforms: all
       - name: Build and test greenlet
@@ -176,12 +182,12 @@
           DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
         run: bash ./make-manylinux
       - name: Store greenlet wheels
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           path: wheelhouse/*whl
           name: ${{ matrix.image }}_wheels.zip
       - name: Publish package to PyPI
-        uses: pypa/gh-action-pypi-publish@v1.4.1
+        uses: pypa/gh-action-pypi-publish@v1.10.1
         if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
         with:
           user: __token__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/CHANGES.rst 
new/greenlet-3.1.0/CHANGES.rst
--- old/greenlet-3.0.3/CHANGES.rst      2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/CHANGES.rst      2024-09-10 18:50:06.000000000 +0200
@@ -2,6 +2,41 @@
  Changes
 =========
 
+3.1.0 (2024-09-10)
+==================
+
+.. note::
+
+    This will be the last release to support Python 3.7 and 3.8.
+
+- Adds support for Python 3.13.
+
+.. note::
+
+   greenlet will not work in no-gil (free threaded) builds of CPython.
+   Internally, greenlet heavily depends on the GIL.
+
+- Greatly reduce the chances for crashes during interpreter shutdown.
+  See `issue 411
+  <https://github.com/python-greenlet/greenlet/issues/411>`_.
+
+Platform Support
+----------------
+
+Support for the following platforms was contributed by the community.
+Note that they are untested by this project's continuous integration
+services.
+
+- Hitachi's `SuperH CPU 
<https://github.com/python-greenlet/greenlet/issues/166>`_.
+- `NetBSD on PowerPC.
+  <https://github.com/python-greenlet/greenlet/pull/402>`_
+- RiscV 64 with `-fno-omit-frame-pointer
+  <https://github.com/python-greenlet/greenlet/pull/404>`_. Note that
+  there are `known test failures
+  <https://github.com/python-greenlet/greenlet/issues/403>`_, so this
+  platform may not work reliably at all.
+
+
 3.0.3 (2023-12-21)
 ==================
 
@@ -175,7 +210,7 @@
 =====================
 
 - Linux: Fix another group of rare crashes that could occur when shutting down 
an
-  interpeter running multiple threads. See `issue 325 
<https://github.com/python-greenlet/greenlet/issues/325>`_.
+  interpreter running multiple threads. See `issue 325 
<https://github.com/python-greenlet/greenlet/issues/325>`_.
 
 
 2.0.0rc4 (2022-10-30)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/PKG-INFO new/greenlet-3.1.0/PKG-INFO
--- old/greenlet-3.0.3/PKG-INFO 2023-12-21 22:57:41.091845500 +0100
+++ new/greenlet-3.1.0/PKG-INFO 2024-09-10 18:50:06.684404000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: greenlet
-Version: 3.0.3
+Version: 3.1.0
 Summary: Lightweight in-process concurrent programming
 Home-page: https://greenlet.readthedocs.io/
 Author: Alexey Borzenkov
@@ -27,15 +27,20 @@
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: 3.11
 Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
 Classifier: Operating System :: OS Independent
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Requires-Python: >=3.7
 Description-Content-Type: text/x-rst
-Provides-Extra: docs
-Provides-Extra: test
 License-File: LICENSE
 License-File: LICENSE.PSF
 License-File: AUTHORS
+Provides-Extra: docs
+Requires-Dist: Sphinx; extra == "docs"
+Requires-Dist: furo; extra == "docs"
+Provides-Extra: test
+Requires-Dist: objgraph; extra == "test"
+Requires-Dist: psutil; extra == "test"
 
 .. This file is included into docs/history.rst
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/appveyor.yml 
new/greenlet-3.1.0/appveyor.yml
--- old/greenlet-3.0.3/appveyor.yml     2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/appveyor.yml     2024-09-10 18:50:06.000000000 +0200
@@ -42,6 +42,12 @@
 
     # Fully supported 64-bit versions, with testing. This should be
     # all the current (non EOL) versions.
+    - PYTHON: "C:\\Python313-x64"
+      PYTHON_VERSION: "3.13.0"
+      PYTHON_ARCH: "64"
+      PYTHON_EXE: python
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
+
     - PYTHON: "C:\\Python312-x64"
       PYTHON_VERSION: "3.12.0"
       PYTHON_ARCH: "64"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/make-manylinux 
new/greenlet-3.1.0/make-manylinux
--- old/greenlet-3.0.3/make-manylinux   2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/make-manylinux   2024-09-10 18:50:06.000000000 +0200
@@ -26,13 +26,20 @@
     # Build in an isolated directory
     mkdir /tmp/build
     cd /tmp/build
+    git config --global --add safe.directory /greenlet/.git
     git clone /greenlet greenlet
     cd greenlet
 
     mkdir -p /greenlet/wheelhouse
     OPATH="$PATH"
     which auditwheel
-    for variant in `ls -d /opt/python/cp{37,38,39,310,311,312}*`; do
+    echo "Installed Python versions"
+    ls -l /opt/python
+    for variant in `ls -d /opt/python/cp{313,37,38,39,310,311,312}*`; do
+        if [ "$variant" = "/opt/python/cp313-313t" ]; then
+            echo "Skipping no-gil build. The GIL is required."
+            continue
+        fi
         export PATH="$variant/bin:$OPATH"
         echo "Building $variant $(python --version)"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/setup.py new/greenlet-3.1.0/setup.py
--- old/greenlet-3.0.3/setup.py 2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/setup.py 2024-09-10 18:50:06.000000000 +0200
@@ -241,6 +241,7 @@
         'Programming Language :: Python :: 3.10',
         'Programming Language :: Python :: 3.11',
         'Programming Language :: Python :: 3.12',
+        'Programming Language :: Python :: 3.13',
         'Operating System :: OS Independent',
         'Topic :: Software Development :: Libraries :: Python Modules'
     ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/TPythonState.cpp 
new/greenlet-3.1.0/src/greenlet/TPythonState.cpp
--- old/greenlet-3.0.3/src/greenlet/TPythonState.cpp    2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/TPythonState.cpp    2024-09-10 
18:50:06.000000000 +0200
@@ -18,7 +18,11 @@
 #else
     ,recursion_depth(0)
 #endif
+#if GREENLET_PY313
+    ,delete_later(nullptr)
+#else
     ,trash_delete_nesting(0)
+#endif
 #if GREENLET_PY311
     ,current_frame(nullptr)
     ,datastack_chunk(nullptr)
@@ -130,11 +134,15 @@
 #if GREENLET_PY311
   #if GREENLET_PY312
     this->py_recursion_depth = tstate->py_recursion_limit - 
tstate->py_recursion_remaining;
-    this->c_recursion_depth = C_RECURSION_LIMIT - 
tstate->c_recursion_remaining;
+    this->c_recursion_depth = Py_C_RECURSION_LIMIT - 
tstate->c_recursion_remaining;
   #else // not 312
     this->recursion_depth = tstate->recursion_limit - 
tstate->recursion_remaining;
   #endif // GREENLET_PY312
+  #if GREENLET_PY313
+    this->current_frame = tstate->current_frame;
+  #elif GREENLET_USE_CFRAME
     this->current_frame = tstate->cframe->current_frame;
+  #endif
     this->datastack_chunk = tstate->datastack_chunk;
     this->datastack_top = tstate->datastack_top;
     this->datastack_limit = tstate->datastack_limit;
@@ -143,7 +151,9 @@
     Py_XDECREF(frame);  // PyThreadState_GetFrame gives us a new
                         // reference.
     this->_top_frame.steal(frame);
-  #if GREENLET_PY312
+  #if GREENLET_PY313
+    this->delete_later = Py_XNewRef(tstate->delete_later);
+  #elif GREENLET_PY312
     this->trash_delete_nesting = tstate->trash.delete_nesting;
   #else // not 312
     this->trash_delete_nesting = tstate->trash_delete_nesting;
@@ -199,17 +209,25 @@
 #if GREENLET_PY311
   #if GREENLET_PY312
     tstate->py_recursion_remaining = tstate->py_recursion_limit - 
this->py_recursion_depth;
-    tstate->c_recursion_remaining = C_RECURSION_LIMIT - 
this->c_recursion_depth;
+    tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - 
this->c_recursion_depth;
     this->unexpose_frames();
   #else // \/ 3.11
     tstate->recursion_remaining = tstate->recursion_limit - 
this->recursion_depth;
   #endif // GREENLET_PY312
+  #if GREENLET_PY313
+    tstate->current_frame = this->current_frame;
+  #elif GREENLET_USE_CFRAME
     tstate->cframe->current_frame = this->current_frame;
+  #endif
     tstate->datastack_chunk = this->datastack_chunk;
     tstate->datastack_top = this->datastack_top;
     tstate->datastack_limit = this->datastack_limit;
     this->_top_frame.relinquish_ownership();
-  #if GREENLET_PY312
+  #if GREENLET_PY313
+    Py_XDECREF(tstate->delete_later);
+    tstate->delete_later = this->delete_later;
+    Py_CLEAR(this->delete_later);
+  #elif GREENLET_PY312
     tstate->trash.delete_nesting = this->trash_delete_nesting;
   #else // not 3.12
     tstate->trash_delete_nesting = this->trash_delete_nesting;
@@ -238,7 +256,7 @@
 #if GREENLET_PY312
     this->py_recursion_depth = tstate->py_recursion_limit - 
tstate->py_recursion_remaining;
     // XXX: TODO: Comment from a reviewer:
-    //     Should this be ``C_RECURSION_LIMIT - 
tstate->c_recursion_remaining``?
+    //     Should this be ``Py_C_RECURSION_LIMIT - 
tstate->c_recursion_remaining``?
     // But to me it looks more like that might not be the right
     // initialization either?
     this->c_recursion_depth = tstate->py_recursion_limit - 
tstate->py_recursion_remaining;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/TThreadStateDestroy.cpp 
new/greenlet-3.1.0/src/greenlet/TThreadStateDestroy.cpp
--- old/greenlet-3.0.3/src/greenlet/TThreadStateDestroy.cpp     2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/TThreadStateDestroy.cpp     2024-09-10 
18:50:06.000000000 +0200
@@ -96,6 +96,23 @@
     // Python < 3.8 or >= 3.9
     static int AddPendingCall(int (*func)(void*), void* arg)
     {
+        // If the interpreter is in the middle of finalizing, we can't add a
+        // pending call. Trying to do so will end up in a SIGSEGV, as
+        // Py_AddPendingCall will not be able to get the interpreter and will
+        // try to dereference a NULL pointer. It's possible this can still
+        // segfault if we happen to get context switched, and maybe we should
+        // just always implement our own AddPendingCall, but I'd like to see if
+        // this works first
+#if GREENLET_PY313
+        if (Py_IsFinalizing()) {
+#else
+        if (_Py_IsFinalizing()) {
+#endif
+            fprintf(stderr,
+                    "greenlet: WARNING: Interpreter is finalizing. Ignoring "
+                    "call to Py_AddPendingCall; \n");
+            return 0;
+        }
         return Py_AddPendingCall(func, arg);
     }
 #endif
@@ -122,7 +139,7 @@
 
         // NOTE: Because we're not holding the GIL here, some other
         // Python thread could run and call ``os.fork()``, which would
-        // be bad if that happenend while we are holding the cleanup
+        // be bad if that happened while we are holding the cleanup
         // lock (it wouldn't function in the child process).
         // Make a best effort to try to keep the duration we hold the
         // lock short.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/__init__.py 
new/greenlet-3.1.0/src/greenlet/__init__.py
--- old/greenlet-3.0.3/src/greenlet/__init__.py 2023-12-21 22:57:40.000000000 
+0100
+++ new/greenlet-3.1.0/src/greenlet/__init__.py 2024-09-10 18:50:06.000000000 
+0200
@@ -25,7 +25,7 @@
 ###
 # Metadata
 ###
-__version__ = '3.0.3'
+__version__ = '3.1.0'
 from ._greenlet import _C_API # pylint:disable=no-name-in-module
 
 ###
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/greenlet.cpp 
new/greenlet-3.1.0/src/greenlet/greenlet.cpp
--- old/greenlet-3.0.3/src/greenlet/greenlet.cpp        2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/greenlet.cpp        2024-09-10 
18:50:06.000000000 +0200
@@ -243,7 +243,7 @@
 {
     PyArgParseParam run;
     PyArgParseParam nparent;
-    static const char* const kwlist[] = {
+    static char* kwlist[] = {
         "run",
         "parent",
         NULL
@@ -251,7 +251,7 @@
 
     // recall: The O specifier does NOT increase the reference count.
     if (!PyArg_ParseTupleAndKeywords(
-             args, kwargs, "|OO:green", (char**)kwlist, &run, &nparent)) {
+             args, kwargs, "|OO:green", kwlist, &run, &nparent)) {
         return -1;
     }
 
@@ -1220,7 +1220,7 @@
 PyDoc_STRVAR(mod_set_thread_local_doc,
              "set_thread_local(key, value) -> None\n"
              "\n"
-             "Set a value in the current thread-local dictionary. Debbuging 
only.\n");
+             "Set a value in the current thread-local dictionary. Debugging 
only.\n");
 
 static PyObject*
 mod_set_thread_local(PyObject* UNUSED(module), PyObject* args)
@@ -1328,6 +1328,7 @@
     Py_RETURN_NONE;
 }
 
+#if !GREENLET_PY313
 PyDoc_STRVAR(mod_get_tstate_trash_delete_nesting_doc,
              "get_tstate_trash_delete_nesting() -> Integer\n"
              "\n"
@@ -1343,6 +1344,7 @@
     return PyLong_FromLong(tstate->trash_delete_nesting);
 #endif
 }
+#endif
 
 static PyMethodDef GreenMethods[] = {
     {"getcurrent",
@@ -1356,7 +1358,9 @@
     {"get_total_main_greenlets", (PyCFunction)mod_get_total_main_greenlets, 
METH_NOARGS, mod_get_total_main_greenlets_doc},
     {"get_clocks_used_doing_optional_cleanup", 
(PyCFunction)mod_get_clocks_used_doing_optional_cleanup, METH_NOARGS, 
mod_get_clocks_used_doing_optional_cleanup_doc},
     {"enable_optional_cleanup", (PyCFunction)mod_enable_optional_cleanup, 
METH_O, mod_enable_optional_cleanup_doc},
+#if !GREENLET_PY313
     {"get_tstate_trash_delete_nesting", 
(PyCFunction)mod_get_tstate_trash_delete_nesting, METH_NOARGS, 
mod_get_tstate_trash_delete_nesting_doc},
+#endif
     {NULL, NULL} /* Sentinel */
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/greenlet-3.0.3/src/greenlet/greenlet_cpython_compat.hpp 
new/greenlet-3.1.0/src/greenlet/greenlet_cpython_compat.hpp
--- old/greenlet-3.0.3/src/greenlet/greenlet_cpython_compat.hpp 2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/greenlet_cpython_compat.hpp 2024-09-10 
18:50:06.000000000 +0200
@@ -12,19 +12,24 @@
 
 #if PY_VERSION_HEX >= 0x30A00B1
 #    define GREENLET_PY310 1
+#else
+#    define GREENLET_PY310 0
+#endif
+
 /*
 Python 3.10 beta 1 changed tstate->use_tracing to a nested cframe member.
 See https://github.com/python/cpython/pull/25276
 We have to save and restore this as well.
+
+Python 3.13 removed PyThreadState.cframe (GH-108035).
 */
+#if GREENLET_PY310 && PY_VERSION_HEX < 0x30D0000
 #    define GREENLET_USE_CFRAME 1
 #else
 #    define GREENLET_USE_CFRAME 0
-#    define GREENLET_PY310 0
 #endif
 
 
-
 #if PY_VERSION_HEX >= 0x30B00A4
 /*
 Greenlet won't compile on anything older than Python 3.11 alpha 4 (see
@@ -50,6 +55,12 @@
 #    define GREENLET_PY312 0
 #endif
 
+#if PY_VERSION_HEX >= 0x30D0000
+#    define GREENLET_PY313 1
+#else
+#    define GREENLET_PY313 0
+#endif
+
 #ifndef Py_SET_REFCNT
 /* Py_REFCNT and Py_SIZE macros are converted to functions
 https://bugs.python.org/issue39573 */
@@ -124,4 +135,8 @@
 }
 #endif
 
+#if !defined(Py_C_RECURSION_LIMIT) && defined(C_RECURSION_LIMIT)
+#  define Py_C_RECURSION_LIMIT C_RECURSION_LIMIT
+#endif
+
 #endif /* GREENLET_CPYTHON_COMPAT_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/greenlet_greenlet.hpp 
new/greenlet-3.1.0/src/greenlet/greenlet_greenlet.hpp
--- old/greenlet-3.0.3/src/greenlet/greenlet_greenlet.hpp       2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/greenlet_greenlet.hpp       2024-09-10 
18:50:06.000000000 +0200
@@ -23,6 +23,7 @@
 #endif
 
 #if GREENLET_PY312
+#  define Py_BUILD_CORE
 #  include "internal/pycore_frame.h"
 #endif
 
@@ -110,7 +111,11 @@
 #else
         int recursion_depth;
 #endif
+#if GREENLET_PY313
+        PyObject *delete_later;
+#else
         int trash_delete_nesting;
+#endif
 #if GREENLET_PY311
         _PyInterpreterFrame* current_frame;
         _PyStackChunk* datastack_chunk;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/greenlet-3.0.3/src/greenlet/platform/switch_riscv_unix.h 
new/greenlet-3.1.0/src/greenlet/platform/switch_riscv_unix.h
--- old/greenlet-3.0.3/src/greenlet/platform/switch_riscv_unix.h        
2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/platform/switch_riscv_unix.h        
2024-09-10 18:50:06.000000000 +0200
@@ -3,7 +3,7 @@
 #ifdef SLP_EVAL
 #define STACK_MAGIC 0
 
-#define REGS_TO_SAVE "s0", "s1", "s2", "s3", "s4", "s5", \
+#define REGS_TO_SAVE "s1", "s2", "s3", "s4", "s5", \
                     "s6", "s7", "s8", "s9", "s10", "s11", "fs0", "fs1", \
                     "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", "fs8", "fs9", \
                     "fs10", "fs11"
@@ -11,20 +11,24 @@
 static int
 slp_switch(void)
 {
+  long fp;
   int ret;
   long *stackref, stsizediff;
   __asm__ volatile ("" : : : REGS_TO_SAVE);
+  __asm__ volatile ("mv %0, fp" : "=r" (fp) : );
   __asm__ volatile ("mv %0, sp" : "=r" (stackref) : );
   {
       SLP_SAVE_STATE(stackref, stsizediff);
       __asm__ volatile (
          "add sp, sp, %0\n\t"
+         "add fp, fp, %0\n\t"
          : /* no outputs */
          : "r" (stsizediff)
          );
       SLP_RESTORE_STATE();
   }
   __asm__ volatile ("" : : : REGS_TO_SAVE);
+  __asm__ volatile ("ld fp, %0" : : "m" (fp));
   __asm__ volatile ("mv %0, zero" : "=r" (ret) : );
   return ret;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/platform/switch_sh_gcc.h 
new/greenlet-3.1.0/src/greenlet/platform/switch_sh_gcc.h
--- old/greenlet-3.0.3/src/greenlet/platform/switch_sh_gcc.h    1970-01-01 
01:00:00.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/platform/switch_sh_gcc.h    2024-09-10 
18:50:06.000000000 +0200
@@ -0,0 +1,36 @@
+#define STACK_REFPLUS 1
+
+#ifdef SLP_EVAL
+#define STACK_MAGIC 0
+#define REGS_TO_SAVE "r8", "r9", "r10", "r11", "r13", \
+                     "fr12", "fr13", "fr14", "fr15"
+
+// r12 Global context pointer, GP
+// r14 Frame pointer, FP
+// r15 Stack pointer, SP
+
+static int
+slp_switch(void)
+{
+    int err;
+    void* fp;
+    int *stackref, stsizediff;
+    __asm__ volatile("" : : : REGS_TO_SAVE);
+    __asm__ volatile("mov.l r14, %0" : "=m"(fp) : :);
+    __asm__("mov r15, %0" : "=r"(stackref));
+    {
+        SLP_SAVE_STATE(stackref, stsizediff);
+        __asm__ volatile(
+            "add %0, r15\n"
+            "add %0, r14\n"
+            : /* no outputs */
+            : "r"(stsizediff));
+        SLP_RESTORE_STATE();
+        __asm__ volatile("mov r0, %0" : "=r"(err) : :);
+    }
+    __asm__ volatile("mov.l %0, r14" : : "m"(fp) :);
+    __asm__ volatile("" : : : REGS_TO_SAVE);
+    return err;
+}
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/slp_platformselect.h 
new/greenlet-3.1.0/src/greenlet/slp_platformselect.h
--- old/greenlet-3.0.3/src/greenlet/slp_platformselect.h        2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/slp_platformselect.h        2024-09-10 
18:50:06.000000000 +0200
@@ -27,6 +27,8 @@
 # include "platform/switch_ppc64_aix.h" /* gcc on AIX/PowerPC 64-bit */
 #elif defined(__GNUC__) && defined(_ARCH_PPC) && defined(_AIX)
 # include "platform/switch_ppc_aix.h" /* gcc on AIX/PowerPC */
+#elif defined(__GNUC__) && defined(__powerpc__) && defined(__NetBSD__)
+#include "platform/switch_ppc_unix.h" /* gcc on NetBSD/powerpc */
 #elif defined(__GNUC__) && defined(sparc)
 # include "platform/switch_sparc_sun_gcc.h" /* SunOS sparc with gcc */
 #elif defined(__SUNPRO_C) && defined(sparc) && defined(sun)
@@ -64,6 +66,8 @@
 # include "platform/switch_aarch64_gcc.h" /* LLVM Aarch64 ABI for Windows */
 #elif defined(__GNUC__) && defined(__loongarch64) && defined(__linux__)
 # include "platform/switch_loongarch64_linux.h" /* LoongArch64 */
+#elif defined(__GNUC__) && defined(__sh__)
+# include "platform/switch_sh_gcc.h" /* SuperH */
 #endif
 
 #ifdef __cplusplus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/tests/__init__.py 
new/greenlet-3.1.0/src/greenlet/tests/__init__.py
--- old/greenlet-3.0.3/src/greenlet/tests/__init__.py   2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/tests/__init__.py   2024-09-10 
18:50:06.000000000 +0200
@@ -3,10 +3,7 @@
 Tests for greenlet.
 
 """
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
+import os
 import sys
 import unittest
 
@@ -27,7 +24,14 @@
 from . import leakcheck
 
 PY312 = sys.version_info[:2] >= (3, 12)
+PY313 = sys.version_info[:2] >= (3, 13)
+
 WIN = sys.platform.startswith("win")
+RUNNING_ON_GITHUB_ACTIONS = os.environ.get('GITHUB_ACTIONS')
+RUNNING_ON_TRAVIS = os.environ.get('TRAVIS') or RUNNING_ON_GITHUB_ACTIONS
+RUNNING_ON_APPVEYOR = os.environ.get('APPVEYOR')
+RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR
+RUNNING_ON_MANYLINUX = os.environ.get('GREENLET_MANYLINUX')
 
 class TestCaseMetaClass(type):
     # wrap each test method with
@@ -203,7 +207,6 @@
 
     def run_script(self, script_name, show_output=True):
         import subprocess
-        import os
         script = os.path.join(
             os.path.dirname(__file__),
             script_name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet/tests/test_greenlet.py 
new/greenlet-3.1.0/src/greenlet/tests/test_greenlet.py
--- old/greenlet-3.0.3/src/greenlet/tests/test_greenlet.py      2023-12-21 
22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/tests/test_greenlet.py      2024-09-10 
18:50:06.000000000 +0200
@@ -1,17 +1,17 @@
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
 import gc
 import sys
 import time
 import threading
+import unittest
 
-from abc import ABCMeta, abstractmethod
+from abc import ABCMeta
+from abc import abstractmethod
 
 import greenlet
 from greenlet import greenlet as RawGreenlet
 from . import TestCase
+from . import RUNNING_ON_MANYLINUX
+from . import PY313
 from .leakcheck import fails_leakcheck
 
 
@@ -207,10 +207,7 @@
         # we don't get the exception, it just gets printed.
         # When we run on 3.8 only, we can use sys.unraisablehook
         oldstderr = sys.stderr
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from io import StringIO
+        from io import StringIO
         stderr = sys.stderr = StringIO()
         try:
             del g
@@ -223,6 +220,13 @@
         self.assertIn("SomeError", v)
 
 
+    @unittest.skipIf(
+        PY313 and RUNNING_ON_MANYLINUX,
+        "Sometimes flaky (getting one GreenletExit in the second list)"
+        # Probably due to funky timing interactions?
+        # TODO: FIXME Make that work.
+    )
+
     def test_dealloc_other_thread(self):
         seen = []
         someref = []
@@ -471,7 +475,9 @@
         # Unfortunately, this doesn't actually clear the references, they're 
in the
         # fast local array.
         if not wait_for_cleanup:
-            result[0].gr_frame.f_locals.clear()
+            # f_locals has no clear method in Python 3.13
+            if hasattr(result[0].gr_frame.f_locals, 'clear'):
+                result[0].gr_frame.f_locals.clear()
         else:
             self.assertIsNone(result[0].gr_frame)
 
@@ -714,6 +720,13 @@
         del self.glets
         self.assertEqual(sys.getrefcount(Greenlet), initial_refs)
 
+    @unittest.skipIf(
+        PY313 and RUNNING_ON_MANYLINUX,
+        "The manylinux images appear to hang on this test on 3.13rc2"
+        # Or perhaps I just got tired of waiting for the 450s timeout.
+        # Still, it shouldn't take anywhere near that long. Does not reproduce 
in
+        # Ubuntu images, on macOS or Windows.
+    )
     def test_issue_245_reference_counting_subclass_threads(self):
         # https://github.com/python-greenlet/greenlet/issues/245
         from threading import Thread
@@ -1307,5 +1320,4 @@
         )
 
 if __name__ == '__main__':
-    import unittest
     unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/greenlet-3.0.3/src/greenlet/tests/test_greenlet_trash.py 
new/greenlet-3.1.0/src/greenlet/tests/test_greenlet_trash.py
--- old/greenlet-3.0.3/src/greenlet/tests/test_greenlet_trash.py        
2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet/tests/test_greenlet_trash.py        
2024-09-10 18:50:06.000000000 +0200
@@ -29,9 +29,19 @@
 
 import unittest
 
+
 class TestTrashCanReEnter(unittest.TestCase):
 
     def test_it(self):
+        try:
+            # pylint:disable-next=no-name-in-module
+            from greenlet._greenlet import get_tstate_trash_delete_nesting # 
pylint:disable=unused-import
+        except ImportError:
+            import sys
+            # Python 3.13 has not "trash delete nesting" anymore (but "delete 
later")
+            assert sys.version_info[:2] >= (3, 13)
+            self.skipTest("get_tstate_trash_delete_nesting is not available.")
+
         # Try several times to trigger it, because it isn't 100%
         # reliable.
         for _ in range(10):
@@ -40,7 +50,6 @@
     def check_it(self): # pylint:disable=too-many-statements
         import greenlet
         from greenlet._greenlet import get_tstate_trash_delete_nesting # 
pylint:disable=no-name-in-module
-
         main = greenlet.getcurrent()
 
         assert get_tstate_trash_delete_nesting() == 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet.egg-info/PKG-INFO 
new/greenlet-3.1.0/src/greenlet.egg-info/PKG-INFO
--- old/greenlet-3.0.3/src/greenlet.egg-info/PKG-INFO   2023-12-21 
22:57:41.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet.egg-info/PKG-INFO   2024-09-10 
18:50:06.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: greenlet
-Version: 3.0.3
+Version: 3.1.0
 Summary: Lightweight in-process concurrent programming
 Home-page: https://greenlet.readthedocs.io/
 Author: Alexey Borzenkov
@@ -27,15 +27,20 @@
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: 3.11
 Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
 Classifier: Operating System :: OS Independent
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Requires-Python: >=3.7
 Description-Content-Type: text/x-rst
-Provides-Extra: docs
-Provides-Extra: test
 License-File: LICENSE
 License-File: LICENSE.PSF
 License-File: AUTHORS
+Provides-Extra: docs
+Requires-Dist: Sphinx; extra == "docs"
+Requires-Dist: furo; extra == "docs"
+Provides-Extra: test
+Requires-Dist: objgraph; extra == "test"
+Requires-Dist: psutil; extra == "test"
 
 .. This file is included into docs/history.rst
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/src/greenlet.egg-info/SOURCES.txt 
new/greenlet-3.1.0/src/greenlet.egg-info/SOURCES.txt
--- old/greenlet-3.0.3/src/greenlet.egg-info/SOURCES.txt        2023-12-21 
22:57:41.000000000 +0100
+++ new/greenlet-3.1.0/src/greenlet.egg-info/SOURCES.txt        2024-09-10 
18:50:06.000000000 +0200
@@ -14,6 +14,7 @@
 setup.cfg
 setup.py
 tox.ini
+.github/dependabot.yml
 .github/workflows/tests.yml
 appveyor/install.ps1
 appveyor/run_with_env.cmd
@@ -90,6 +91,7 @@
 src/greenlet/platform/switch_ppc_unix.h
 src/greenlet/platform/switch_riscv_unix.h
 src/greenlet/platform/switch_s390_unix.h
+src/greenlet/platform/switch_sh_gcc.h
 src/greenlet/platform/switch_sparc_sun_gcc.h
 src/greenlet/platform/switch_x32_unix.h
 src/greenlet/platform/switch_x64_masm.asm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/greenlet-3.0.3/tox.ini new/greenlet-3.1.0/tox.ini
--- old/greenlet-3.0.3/tox.ini  2023-12-21 22:57:40.000000000 +0100
+++ new/greenlet-3.1.0/tox.ini  2024-09-10 18:50:06.000000000 +0200
@@ -1,6 +1,6 @@
 [tox]
 envlist =
-    py37,py38,py39,py310,py27-ns,py310-ns,py311,py311-ns,docs
+    py{37,38,39,310,311,312,313},py{310,311,312,313}-ns,docs
 
 [testenv]
 commands =

Reply via email to