diff --git a/desktop/core/base_requirements.txt b/desktop/core/base_requirements.txt index 1f7a25adc62..bb4dfedef85 100644 --- a/desktop/core/base_requirements.txt +++ b/desktop/core/base_requirements.txt @@ -8,9 +8,9 @@ cffi==1.15.0 channels==4.2.2 channels-redis==4.2.1 configobj==5.0.9 -cx-Oracle==8.3.0 +oracledb==2.0.0 django-auth-ldap==4.3.0 -Django==4.2.23 +Django==4.2.24 daphne==3.0.2 django-redis==5.4.0 django-celery-beat==2.6.0 diff --git a/desktop/core/build-constraints.txt b/desktop/core/build-constraints.txt deleted file mode 100644 index 9a2ababa032..00000000000 --- a/desktop/core/build-constraints.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Build-time constraints to prevent setuptools 82+ from breaking cx-Oracle -# See: https://github.com/oracle/python-cx_Oracle/blob/main/setup.py (imports pkg_resources) -# setuptools 82+ removed pkg_resources, causing build failures -setuptools<82 diff --git a/desktop/core/generate_requirements.py b/desktop/core/generate_requirements.py index e96c773a297..ec3e5142242 100755 --- a/desktop/core/generate_requirements.py +++ b/desktop/core/generate_requirements.py @@ -54,9 +54,9 @@ def __init__(self): "channels==4.2.2", "channels-redis==4.2.1", "configobj==5.0.9", - "cx-Oracle==8.3.0", + "oracledb==2.0.0", "daphne==3.0.2", - "Django==4.2.23", + "Django==4.2.24", "django-auth-ldap==4.3.0", "django-celery-beat==2.6.0", "django-celery-results==2.5.1", diff --git a/desktop/core/src/desktop/metrics.py b/desktop/core/src/desktop/metrics.py index 51faa6c1e3d..3f9b3452d84 100644 --- a/desktop/core/src/desktop/metrics.py +++ b/desktop/core/src/desktop/metrics.py @@ -23,7 +23,7 @@ from builtins import range from datetime import datetime, timedelta -from cx_Oracle import DatabaseError as OracleDatabaseError +from oracledb import DatabaseError as OracleDatabaseError from django.db import connection from django.db.utils import DatabaseError, OperationalError from future import standard_library diff --git a/desktop/core/src/desktop/tests.py b/desktop/core/src/desktop/tests.py index 14775746c75..30d5fc7887b 100644 --- a/desktop/core/src/desktop/tests.py +++ b/desktop/core/src/desktop/tests.py @@ -794,22 +794,22 @@ def test_check_config_ajax(): assert "misconfiguration" in response.content, response.content -def test_cx_Oracle(): +def test_oracledb(): """ - Tests that cx_Oracle (external dependency) is built correctly. + Tests that oracledb (external dependency) is built correctly. """ if 'ORACLE_HOME' not in os.environ and 'ORACLE_INSTANTCLIENT_HOME' not in os.environ: pytest.skip("Skipping Test") try: - import cx_Oracle + import oracledb return except ImportError as ex: if "No module named" in ex.message: assert ( False, - "cx_Oracle skipped its build. This happens if " + "oracledb skipped its build. This happens if " "env var ORACLE_HOME or ORACLE_INSTANTCLIENT_HOME is not defined. " "So ignore this test failure if your build does not need to work " "with an oracle backend.", diff --git a/desktop/libs/librdbms/src/librdbms/server/oracle_lib.py b/desktop/libs/librdbms/src/librdbms/server/oracle_lib.py index f0a2b526342..3c4e0c22abc 100644 --- a/desktop/libs/librdbms/src/librdbms/server/oracle_lib.py +++ b/desktop/libs/librdbms/src/librdbms/server/oracle_lib.py @@ -18,10 +18,10 @@ import logging try: - import cx_Oracle as Database + import oracledb as Database except ImportError as e: from django.core.exceptions import ImproperlyConfigured - raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) + raise ImproperlyConfigured("Error loading oracledb module: %s" % e) from librdbms.server.rdbms_base_lib import BaseRDBMSDataTable, BaseRDBMSResult, BaseRDMSClient diff --git a/docs/docs-site/content/administrator/configuration/connectors/_index.md b/docs/docs-site/content/administrator/configuration/connectors/_index.md index a5072bc2f4c..43a6ed6b3fe 100644 --- a/docs/docs-site/content/administrator/configuration/connectors/_index.md +++ b/docs/docs-site/content/administrator/configuration/connectors/_index.md @@ -204,7 +204,7 @@ Currently, only [basic LDAP authentication](https://github.com/trinodb/trino-pyt The dialect should be added to the Python system or Hue Python virtual environment: - ./build/env/bin/pip install cx_Oracle + ./build/env/bin/pip install oracledb Then give Hue the information about the database source: