Skip to content

Commit 11e0a2b

Browse files
heptauclaude
andcommitted
fix(deps): replace cx_Oracle with oracledb (Python 3.12 compatible)
cx_Oracle 8.3.0 has no Python 3.12 wheels and its setup.py fails in pip's isolated build environment. oracledb is Oracle's official replacement (released 2022, has binary wheels for all platforms). Add a backward-compatibility shim so existing cx_Oracle code continues to work without changes to callers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8bc750e commit 11e0a2b

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ jobs:
7575

7676
- name: Install Python dependencies
7777
shell: bash
78-
run: |
79-
pip install --upgrade setuptools
80-
pip install -r requirements.txt pyinstaller
78+
run: pip install -r requirements.txt pyinstaller
8179

8280
- name: Build
8381
shell: bash

OmniDB/OmniDB_app/include/Spartacus/Database.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,21 @@ def __init__(self):
7878
except ImportError:
7979
pass
8080
try:
81-
import cx_Oracle
81+
import oracledb
82+
# Compatibility shim: oracledb is the official cx_Oracle replacement (Oracle 2022+)
83+
oracledb.NUMBER = oracledb.DB_TYPE_NUMBER
84+
oracledb.CLOB = oracledb.DB_TYPE_CLOB
85+
oracledb.BLOB = oracledb.DB_TYPE_BLOB
86+
oracledb.LONG_STRING = str
87+
oracledb.LONG_BINARY = bytes
88+
cx_Oracle = oracledb
8289
v_supported_rdbms.append('Oracle')
8390
except ImportError:
84-
pass
91+
try:
92+
import cx_Oracle
93+
v_supported_rdbms.append('Oracle')
94+
except ImportError:
95+
pass
8596
try:
8697
import pymssql
8798
v_supported_rdbms.append('MSSQL')

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies = [
1919
"psycopg2-binary>=2.9.12",
2020
"psycopg[binary]",
2121
"RestrictedPython",
22-
"cx_Oracle",
22+
"oracledb",
2323
"PyMySQL",
2424
"sqlparse",
2525
"pgspecial>=1.11.1",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sshtunnel
1010
psycopg2-binary>=2.9.12
1111
psycopg[binary]
1212
RestrictedPython
13-
cx_Oracle
13+
oracledb
1414
PyMySQL
1515
sqlparse
1616
pgspecial>=1.11.1

0 commit comments

Comments
 (0)