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(