From 6c248d8cf0c6a752fddf6a38d2ee7e12c6e8196c Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Tue, 13 Oct 2026 18:22:39 +0200 Subject: [PATCH] Drop fetch_lobs compatibility probe; require seerdb>=3.0.0 and Python 3.11 seerdb 3.0.0 is released and is now the driver floor, so the import-time probe for fetch_lobs support is dead weight -- the branch can never be False. - pyproject: seerdb>=2.5.0 -> seerdb>=3.0.0 - remove _driver_has_fetch_lobs() / _DRIVER_HAS_FETCH_LOBS - pass fetch_lobs=False unconditionally in create_connect_args - CI: move the SQLAlchemy pin 2.0.54 -> 2.1.0 in tests.yml and compliance.yml (seerdb 2.5.0 failed BooleanTest on 23ai under SQLAlchemy 2.1, fixed in 3.0.0) - entry-point smoke test now asserts fetch_lobs unconditionally - Python floor 3.10 -> 3.11: SQLAlchemy 2.1 requires 3.11, so the pinned version cannot install on 3.10, and 3.10 reaches end of life in October 2026. The Package matrix drops 3.10 and the lint job runs on 3.11. The driver keeps its own floor; this is the dialect's alone. Dropping pre-3.0 driver support and Python 3.10 is a minor bump: 0.2.2 -> 0.3.0. Closes #16 Signed-off-by: Peter Lemenkov Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/compliance.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/tests.yml | 13 ++++++------- pyproject.toml | 6 +++--- sqlalchemy_seerdb/seerdb.py | 25 ++----------------------- 5 files changed, 13 insertions(+), 35 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index d35053f..4ede9c1 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -24,7 +24,7 @@ env: # The SQLAlchemy every run installs: one exact version, never a range or the # newest release, so a run changes only when this line does. A newer # SQLAlchemy is a deliberate upgrade of its own. - SQLALCHEMY: "2.0.54" + SQLALCHEMY: "2.1.0" jobs: compliance: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fe7a27b..090ada1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 with: - python-version: "3.10" + python-version: "3.11" - run: pip install ruff - run: ruff check sqlalchemy_seerdb test - run: ruff format --check sqlalchemy_seerdb test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fac9453..0d7cdaf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ env: # The SQLAlchemy every run installs: one exact version, never a range or the # newest release, so a run changes only when this line does. A newer # SQLAlchemy is a deliberate upgrade of its own. - SQLALCHEMY: "2.0.54" + SQLALCHEMY: "2.1.0" jobs: # The gating job, and deliberately the only one. It needs no database, so it @@ -44,7 +44,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 @@ -69,15 +69,14 @@ jobs: # commits every statement unless told otherwise, and SQLAlchemy's # transactions would mean nothing. args = dialect().create_connect_args(url)[1] - # fetch_lobs is feature-detected in the dialect: it is present (False) - # only with seerdb >= 3.0 and absent on older drivers, which the - # dialect supports on purpose. Pop it so this check covers both. - fetch_lobs = args.pop('fetch_lobs', None) + # fetch_lobs is always requested now that the driver floor is + # seerdb>=3.0.0 (it returns LOB objects by default; this dialect is + # built on the values). assert args == { 'host': 'h', 'port': 1521, 'user': 'u', 'password': 'p', 'service_name': 'XE', 'timeout': 5000, 'autocommit': False, + 'fetch_lobs': False, }, args - assert fetch_lobs in (None, False), fetch_lobs assert isinstance(args['timeout'], int), 'query args must be coerced' print('entry point OK:', dialect.__module__ + '.' + dialect.__name__) PY diff --git a/pyproject.toml b/pyproject.toml index 1bc6446..91eb5d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,12 +7,12 @@ build-backend = "setuptools.build_meta" [project] name = "sqlalchemy-seerdb" -version = "0.2.2" +version = "0.3.0" description = "SQLAlchemy dialect for the seerdb driver" readme = "README.md" license = "MIT" license-files = ["LICENSES/MIT.txt"] -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [{ name = "Peter Lemenkov", email = "lemenkov@gmail.com" }] keywords = ["sqlalchemy", "dialect", "database", "dbapi"] classifiers = [ @@ -21,7 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: Database", ] -dependencies = ["SQLAlchemy>=2.0", "seerdb>=2.5.0"] +dependencies = ["SQLAlchemy>=2.0", "seerdb>=3.0.0"] [project.urls] Homepage = "https://github.com/seerdb/sqlalchemy-seerdb" diff --git a/sqlalchemy_seerdb/seerdb.py b/sqlalchemy_seerdb/seerdb.py index 85efa6b..8da1c71 100644 --- a/sqlalchemy_seerdb/seerdb.py +++ b/sqlalchemy_seerdb/seerdb.py @@ -257,23 +257,6 @@ def bindparam_string(self, name, **kw): return super().bindparam_string(name, **kw) -def _driver_has_fetch_lobs() -> bool: - """Whether the installed driver understands ``fetch_lobs``. - - It arrived in seerdb 3.0 together with the LOB object; passing it to an - older driver is a TypeError, and this dialect supports both.""" - import inspect - - try: - params = inspect.signature(seerdb.OracleConnect.__init__).parameters - except (AttributeError, TypeError, ValueError): - return False - return 'fetch_lobs' in params - - -_DRIVER_HAS_FETCH_LOBS = _driver_has_fetch_lobs() - - class SeerdbDialect(OracleDialect): """SQLAlchemy dialect driving the seerdb DBAPI.""" @@ -393,12 +376,8 @@ def create_connect_args(self, url: URL) -> tuple[list, dict]: # comparison the compliance suite makes, are written against values. # seerdb 3.0 returns a LOB OBJECT by default instead (matching # python-oracledb), so ask for the values this dialect is built on. - # - # Feature-detected rather than pinned: the same dialect still has to - # work against a driver that predates the option, and its floor cannot - # be raised to a release that is not published yet. - if _DRIVER_HAS_FETCH_LOBS: - options['fetch_lobs'] = False + # The driver floor is seerdb>=3.0.0, so the option is always understood. + options['fetch_lobs'] = False for key, value in url.query.items(): # A repeated key arrives as a tuple; the driver takes one value. options[key] = _coerce(