From 09978d6cb665d9a6a0bd380ab5770bdb3b2cb723 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Tue, 10 Jun 2025 10:46:59 +0300 Subject: [PATCH 1/3] python: github_actions: add test for Python 3.13 --- .github/workflows/pymi-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pymi-cd.yml b/.github/workflows/pymi-cd.yml index 051cb1e..a4293f1 100644 --- a/.github/workflows/pymi-cd.yml +++ b/.github/workflows/pymi-cd.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 100 matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 From 60d69552974b0b5fdec0dcb48c690c25efdaaa36 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Tue, 10 Jun 2025 10:49:59 +0300 Subject: [PATCH 2/3] python: github_actions: use v4 for artifact actions See: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ --- .github/workflows/pymi-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pymi-cd.yml b/.github/workflows/pymi-cd.yml index a4293f1..b8b8596 100644 --- a/.github/workflows/pymi-cd.yml +++ b/.github/workflows/pymi-cd.yml @@ -26,7 +26,7 @@ jobs: pip install . || exit /b python -m unittest discover || exit /b python setup.py bdist_wheel || exit /b - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pymi_wheel_py${{ matrix.python-version }} path: 'dist' From 4457123d6e221a1176784cfb565169928bde41a6 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Tue, 10 Jun 2025 10:57:03 +0300 Subject: [PATCH 3/3] python_3.13: use Py_(Is)Initialize(d) instead of (Is)PyEval_InitThreads See: https://docs.python.org/3.9/c-api/init.html#c.PyEval_ThreadsInitialized ``` Returns a non-zero value if PyEval_InitThreads() has been called. This function can be called without holding the GIL, and therefore can be used to avoid calls to the locking API when running single-threaded. Changed in version 3.7: The GIL is now initialized by Py_Initialize(). Deprecated since version 3.9, will be removed in version 3.11. ``` --- PyMI/PyMI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyMI/PyMI.cpp b/PyMI/PyMI.cpp index 9a7edf2..93cc14c 100644 --- a/PyMI/PyMI.cpp +++ b/PyMI/PyMI.cpp @@ -34,9 +34,9 @@ static PyModuleDef mimodule = { PyObject* _initmi(void) { - if (!PyEval_ThreadsInitialized()) + if (!Py_IsInitialized()) { - PyEval_InitThreads(); + Py_Initialize(); } PyDateTime_IMPORT;