Skip to content

Commit 938422c

Browse files
authored
Add support for Python 3.14 (#1039)
* Add Python 3.14 support, fix buffer allocation for bind_param to avoid segmentation fault from test suite test_148_CallSPDiffBindPattern_01.py, and update workflow to use macos-latest --------- Signed-off-by: Earamma K <[email protected]>
1 parent c81ee4f commit 938422c

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

.github/workflows/bld_wheels_and_upload.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
os: [windows-latest]
2020

2121
steps:
22-
- uses: actions/checkout@v4.2.2
22+
- uses: actions/checkout@v5
2323
- name: Build wheels
24-
uses: pypa/cibuildwheel@v2.22.0
24+
uses: pypa/cibuildwheel@v3.1.4
2525
env:
2626
CIBW_BUILD: "*-win_amd64"
27-
CIBW_SKIP: "cp36-* pp*"
27+
CIBW_SKIP: "cp38-*"
2828

2929
- uses: actions/[email protected]
3030
with:
@@ -39,12 +39,12 @@ jobs:
3939
os: [windows-latest]
4040

4141
steps:
42-
- uses: actions/checkout@v4.2.2
42+
- uses: actions/checkout@v5
4343
- name: Build wheels
44-
uses: pypa/cibuildwheel@v2.22.0
44+
uses: pypa/cibuildwheel@v3.1.4
4545
env:
4646
CIBW_BUILD: "*-win32"
47-
CIBW_SKIP: "cp36-* pp*"
47+
CIBW_SKIP: "cp38-*"
4848

4949
- uses: actions/[email protected]
5050
with:
@@ -59,12 +59,14 @@ jobs:
5959
os: [ubuntu-latest]
6060

6161
steps:
62-
- uses: actions/checkout@v4.2.2
62+
- uses: actions/checkout@v5
6363
- name: Build wheels
64-
uses: pypa/cibuildwheel@v2.22.0
64+
uses: pypa/cibuildwheel@v3.1.4
6565
env:
66+
CIBW_ARCHS_LINUX: "x86_64 i686"
67+
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
6668
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
67-
CIBW_SKIP: "cp36-* *-musllinux_* pp* *-*linux_{aarch64,ppc64le}"
69+
CIBW_SKIP: "cp38-* *-musllinux_* *-*linux_{aarch64,ppc64le}"
6870
CIBW_REPAIR_WHEEL_COMMAND_LINUX:
6971
auditwheel repair
7072
--exclude libdb2.so.1
@@ -86,17 +88,17 @@ jobs:
8688

8789
build_wheels_macos_arm64:
8890
name: Build wheels on macOS ARM64
89-
runs-on: macos-14
91+
runs-on: macos-latest
9092
strategy:
9193
matrix:
9294
architecture: [arm64]
9395

9496
steps:
95-
- uses: actions/checkout@v4.2.2
97+
- uses: actions/checkout@v5
9698
- name: Build wheels
97-
uses: pypa/cibuildwheel@v2.22.0
99+
uses: pypa/cibuildwheel@v3.1.4
98100
env:
99-
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*"
101+
CIBW_SKIP: "cp38-*"
100102
MACOSX_DEPLOYMENT_TARGET: 14.0
101103

102104
- uses: actions/[email protected]
@@ -106,17 +108,18 @@ jobs:
106108

107109
build_wheels_macos_x86:
108110
name: Build wheels for macOS x86_64
109-
runs-on: macos-13
111+
runs-on: macos-15-intel
110112
strategy:
111113
matrix:
112114
architecture: [x86_64]
113115

114116
steps:
115-
- uses: actions/checkout@v4.2.2
117+
- uses: actions/checkout@v5
116118
- name: Build wheels
117-
uses: pypa/cibuildwheel@v2.22.0
119+
uses: pypa/cibuildwheel@v3.1.4
118120
env:
119-
CIBW_SKIP: "cp36-* pp*"
121+
CIBW_ARCHS: "x86_64"
122+
CIBW_SKIP: "cp38-*"
120123
MACOSX_DEPLOYMENT_TARGET: 10.15
121124

122125
- uses: actions/[email protected]
@@ -128,7 +131,7 @@ jobs:
128131
name: Build source distribution
129132
runs-on: ubuntu-latest
130133
steps:
131-
- uses: actions/checkout@v4.2.2
134+
- uses: actions/checkout@v5
132135
- name: Install Python dependencies
133136
run: python -m pip install --upgrade pip build
134137
- name: Build sdist
@@ -170,7 +173,7 @@ jobs:
170173
#upload to PyPI on every tag starting with 'v'
171174
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
172175
steps:
173-
- uses: actions/download-artifact@v4.1.7
176+
- uses: actions/download-artifact@v5
174177
with:
175178
path: dist
176179
pattern: ibmdb-*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ https://github.com/ibmdb/python-ibmdb/wiki/APIs
2222

2323
## Pre-requisites
2424

25-
Install Python 3.7 <= 3.13. The minimum python version supported by driver is python 3.7 and the latest version supported is python 3.13.
25+
Install Python 3.9 <= 3.14. The minimum python version supported by driver is python 3.9 and the latest version supported is python 3.14.
2626
MacOS arm64 is supported Python 3.9 onwards.
2727

2828
### To install ibm_db on z/OS system

ibm_db.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7881,9 +7881,9 @@ static int _python_ibm_db_bind_data(stmt_handle *stmt_res, param_node *curr, PyO
78817881
#endif
78827882
curr->svalue = PyBytes_AsString(tempobj);
78837883
curr->ivalue = strlen(curr->svalue);
7884-
curr->svalue = memcpy(PyMem_Malloc((sizeof(char)) * (curr->ivalue + 1)), curr->svalue, curr->ivalue);
7884+
size_t alloc_size = (curr->param_size > curr->ivalue) ? curr->param_size : curr->ivalue;
7885+
curr->svalue = memcpy(PyMem_Malloc((sizeof(char)) * (alloc_size + 1)), curr->svalue, curr->ivalue);
78857886
curr->svalue[curr->ivalue] = '\0';
7886-
curr->bind_indicator = curr->ivalue;
78877887
snprintf(messageStr, sizeof(messageStr),
78887888
"Processing single value: svalue=%s, ivalue=%d, bind_indicator=%d", curr->svalue, curr->ivalue, curr->bind_indicator);
78897889
LogMsg(DEBUG, messageStr);

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,12 @@ def print_exception( e, url):
546546
'Operating System :: MacOS',
547547
'Operating System :: MacOS :: MacOS X',
548548
'Programming Language :: Python',
549-
'Programming Language :: Python :: 3.7',
550-
'Programming Language :: Python :: 3.8',
551549
'Programming Language :: Python :: 3.9',
552550
'Programming Language :: Python :: 3.10',
553551
'Programming Language :: Python :: 3.11',
554552
'Programming Language :: Python :: 3.12',
555553
'Programming Language :: Python :: 3.13',
554+
'Programming Language :: Python :: 3.14',
556555
'Topic :: Database :: Front-Ends'],
557556

558557
long_description = open(readme).read(),

0 commit comments

Comments
 (0)