From 5cff67f22b858530905098eed46e4857f2112e03 Mon Sep 17 00:00:00 2001 From: arnimarj Date: Wed, 11 Sep 2024 18:09:49 +0000 Subject: [PATCH] preliminary 3.13 support --- .github/workflows/package.yml | 8 ++++---- .github/workflows/validate.yml | 6 +++--- setup.py | 15 +++++---------- src-c/judy_int_object_map.c | 4 ++-- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index a986579..fc84b34 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -14,11 +14,11 @@ jobs: matrix: # see https://github.com/actions/runner-images#available-images os: [macos-latest, ubuntu-latest] - python-version: ['3.11'] + python-version: ['3.12'] steps: - name: Setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -29,12 +29,12 @@ jobs: submodules: true - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.15.0 + run: python -m pip install cibuildwheel==2.20.0 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BUILD: pp* cp38-* cp39-* cp310-* cp311-* cp312-* + CIBW_BUILD: pp* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* CIBW_ARCHS: "auto64" - name: Build sdist diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f2c1344..4aebbd0 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,4 +1,4 @@ ---- +`--- name: Validate on: push @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12.0-rc.2'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.2'] steps: - uses: actions/checkout@v4 @@ -19,7 +19,7 @@ jobs: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index da9b488..12e7c9c 100755 --- a/setup.py +++ b/setup.py @@ -28,18 +28,12 @@ def build_judy(): # adding last two flags because of compiler and/or code bugs # see http://sourceforge.net/p/judy/mailman/message/32417284/ - assert(sys.maxsize in (2**63 - 1, 2**31 - 1)) + assert sys.maxsize == (2**63 - 1) if is_clang or is_gcc_46: - if sys.maxsize == 2**63 - 1: - CFLAGS = '-DJU_64BIT -O0 -fPIC -fno-strict-aliasing' - else: - CFLAGS = ' -O0 -fPIC -fno-strict-aliasing' + CFLAGS = '-DJU_64BIT -O0 -fPIC -fno-strict-aliasing' else: - if sys.maxsize == 2**63 - 1: - CFLAGS = '-DJU_64BIT -O0 -fPIC -fno-strict-aliasing -fno-aggressive-loop-optimizations' - else: - CFLAGS = ' -O0 -fPIC -fno-strict-aliasing -fno-aggressive-loop-optimizations' + CFLAGS = '-DJU_64BIT -O0 -fPIC -fno-strict-aliasing -fno-aggressive-loop-optimizations' exitcode, output = subprocess.getstatusoutput('(cd judy-1.0.5/src; CC=\'%s\' COPT=\'%s\' sh ./sh_build)' % (CC, CFLAGS)) @@ -73,7 +67,7 @@ def build_judy(): setup( name='judy', - version='1.0.18', + version='1.0.19', maintainer='Arni Mar Jonsson', maintainer_email='arnimarj@gmail.com', description='A Python wrapper for Judy arrays, which provide fast and space-efficient integer mappings and integer sets, along with ranged ordered iterations', @@ -93,6 +87,7 @@ def build_judy(): 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Database', 'Topic :: Software Development :: Libraries' ], diff --git a/src-c/judy_int_object_map.c b/src-c/judy_int_object_map.c index 338139d..5677a22 100755 --- a/src-c/judy_int_object_map.c +++ b/src-c/judy_int_object_map.c @@ -77,13 +77,13 @@ my_Py_ReprLeave(PyObject *obj) static void judy_io_map_dealloc(PyJudyIntObjectMap* m) { PyObject_GC_UnTrack(m); - Py_TRASHCAN_SAFE_BEGIN(m) + Py_TRASHCAN_SAFE_BEGIN(m); PYJUDY_IO_MAP_FOREACH(m->judy_L, Py_DECREF, PyObject*); Word_t bytes_freed; JLFA(bytes_freed, m->judy_L); m->judy_L = 0; Py_TYPE(m)->tp_free((PyObject*)m); - Py_TRASHCAN_SAFE_END(m) + Py_TRASHCAN_SAFE_END(m); } static int judy_io_map_print(PyJudyIntObjectMap* m, FILE* fp, int flags)