diff --git a/.github/workflows/build-wheels-version.yml b/.github/workflows/build-wheels-version.yml index 4b7bec4..798a472 100644 --- a/.github/workflows/build-wheels-version.yml +++ b/.github/workflows/build-wheels-version.yml @@ -276,10 +276,13 @@ jobs: forge "$FORGE_ARCH" "$package" done - # Drop the support-tree dep wheels produced by make_dep_wheels.py - # iOS deps: bzip2, libffi, mpdecimal, openssl, xz - # Android deps: bzip2, libffi, openssl, sqlite, xz - rm -f dist/bzip2-* dist/libffi-* dist/mpdecimal-* dist/openssl-* dist/sqlite-* dist/xz-* + - name: Drop support-tree dep wheels + if: always() + shell: bash + # Drop the CPython support-tree dep wheels produced by make_dep_wheels.py + # iOS deps: bzip2, libffi, mpdecimal, openssl, xz + # Android deps: bzip2, libffi, openssl, sqlite, xz + run: rm -f dist/bzip2-* dist/libffi-* dist/mpdecimal-* dist/openssl-* dist/sqlite-* dist/xz-* - name: Summarize built wheels if: always() diff --git a/recipes/oracledb/meta.yaml b/recipes/oracledb/meta.yaml new file mode 100644 index 0000000..fdce29c --- /dev/null +++ b/recipes/oracledb/meta.yaml @@ -0,0 +1,18 @@ +package: + name: oracledb + version: 4.0.1 + +build: + number: 1 + +requirements: + # python-oracledb compiles four Cython extensions (base_impl, thin_impl, + # thick_impl, arrow_impl) from .pyx via setuptools+Cython. All native deps are + # vendored in the sdist (ODPI-C for thick mode, nanoarrow for arrow), so there + # is NO external native library to link — no flet-lib* host dep needed. + # `cryptography` (a shipped recipe) and `typing_extensions` (pure-Python) are + # runtime deps carried in the wheel metadata and resolved at app-build time. + # Thick mode dlopens the Oracle Instant Client at runtime only (absent on + # mobile); the default THIN mode is pure sockets and needs no client libs. + build: + - cython diff --git a/recipes/oracledb/tests/test_oracledb.py b/recipes/oracledb/tests/test_oracledb.py new file mode 100644 index 0000000..74f6b46 --- /dev/null +++ b/recipes/oracledb/tests/test_oracledb.py @@ -0,0 +1,29 @@ +def test_import_and_thin_mode(): + """Loads all four Cython extensions — oracledb/__init__.py does + `from . import base_impl, thick_impl, thin_impl` (and arrow) at import, so + this proves every .so cross-compiled and loads. thick_impl loads WITHOUT the + Oracle Instant Client (ODPI-C dlopens it lazily, only on thick init), and the + default THIN mode needs no Oracle client libraries at all.""" + import oracledb + + assert oracledb.__version__ + assert oracledb.is_thin_mode() is True + + +def test_thin_connect_errors_cleanly(): + """No DB server here — prove the thin driver's Cython network/protocol path + actually RUNS on-device by connecting to an unreachable listener and getting + a clean `oracledb.Error` (DB-API base), not an ImportError or native crash.""" + import oracledb + + try: + oracledb.connect( + user="x", + password="x", + dsn="127.0.0.1:1521/FREEPDB1", + tcp_connect_timeout=3, + ) + except oracledb.Error: + pass # expected: nothing is listening, thin driver reports it cleanly + else: + raise AssertionError("expected a connection error against an unreachable DB")