From 96a34b0d35e48d5fb2bd56edecbf432491a86609 Mon Sep 17 00:00:00 2001 From: igorcoding Date: Sun, 1 Dec 2024 13:58:21 +0300 Subject: [PATCH] Added support for python 3.13 (closes #37) --- .github/workflows/actions.yaml | 4 ++-- CHANGELOG.md | 7 +++++++ asynctnt/__init__.py | 2 +- asynctnt/iproto/tupleobj/tupleobj.c | 4 ++-- asynctnt/iproto/tupleobj/tupleobj.h | 8 ++++++++ pyproject.toml | 4 ++-- setup.py | 2 +- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 25b82ac..607d103 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest ] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.10'] tarantool: ['1.10', '2', '3'] exclude: - os: macos-latest @@ -78,7 +78,7 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* pp310-*" + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp310-*" - uses: actions/upload-artifact@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index a29ce89..63c1dcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v2.3.1 +**New features** +* Added support for Python 3.13 [#37](https://github.com/igorcoding/asynctnt/issues/37) + +**Other changes** +* Upgraded Cython to 3.0.11 + ## v2.3.0 **New features:** * Added support for [interval types](https://www.tarantool.io/en/doc/latest/reference/reference_lua/datetime/interval_object/) [#30](https://github.com/igorcoding/asynctnt/issues/30) diff --git a/asynctnt/__init__.py b/asynctnt/__init__.py index 4c8be61..33b6037 100644 --- a/asynctnt/__init__.py +++ b/asynctnt/__init__.py @@ -18,4 +18,4 @@ TarantoolTuple, ) -__version__ = "2.3.0" +__version__ = "2.3.1b1" diff --git a/asynctnt/iproto/tupleobj/tupleobj.c b/asynctnt/iproto/tupleobj/tupleobj.c index c891ee3..bb92690 100644 --- a/asynctnt/iproto/tupleobj/tupleobj.c +++ b/asynctnt/iproto/tupleobj/tupleobj.c @@ -72,7 +72,7 @@ ttuple_dealloc(AtntTupleObject *o) Py_CLEAR(o->metadata); - Py_TRASHCAN_SAFE_BEGIN(o) + CPy_TRASHCAN_BEGIN(o, ttuple_dealloc) if (len > 0) { i = len; while (--i >= 0) { @@ -91,7 +91,7 @@ ttuple_dealloc(AtntTupleObject *o) } Py_TYPE(o)->tp_free((PyObject *)o); done: - Py_TRASHCAN_SAFE_END(o) + CPy_TRASHCAN_END(o) } diff --git a/asynctnt/iproto/tupleobj/tupleobj.h b/asynctnt/iproto/tupleobj/tupleobj.h index 63dba71..80417ce 100644 --- a/asynctnt/iproto/tupleobj/tupleobj.h +++ b/asynctnt/iproto/tupleobj/tupleobj.h @@ -8,6 +8,14 @@ extern "C" { #endif +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 8 +# define CPy_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_BEGIN(op, dealloc) +# define CPy_TRASHCAN_END(op) Py_TRASHCAN_END +#else +# define CPy_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_SAFE_BEGIN(op) +# define CPy_TRASHCAN_END(op) Py_TRASHCAN_SAFE_END(op) +#endif + /* Largest ttuple to save on free list */ #define AtntTuple_MAXSAVESIZE 20 diff --git a/pyproject.toml b/pyproject.toml index 2716b58..0a91beb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ test = [ 'coverage[toml]', 'pytz', 'python-dateutil', - "Cython==3.0.7", # for coverage + "Cython==3.0.11", # for coverage ] docs = [ @@ -63,7 +63,7 @@ requires = [ "setuptools>=60", "wheel", - "Cython==3.0.7", + "Cython==3.0.11", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 1189531..2c4244c 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def find_version(): return re.match(r"""__version__\s*=\s*(['"])([^'"]+)\1""", line).group(2) -CYTHON_VERSION = "3.0.7" +CYTHON_VERSION = "3.0.11" class build_ext(setuptools_build_ext.build_ext):