Skip to content

Commit 1bb2f20

Browse files
XFail duckdb tests in Python 3.12
1 parent 507097c commit 1bb2f20

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

noxfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
]
5353

5454

55+
def _clean_py312_deps(session: Session, dependencies: list[str]) -> None:
56+
"""Clean dependencies for Python 3.12."""
57+
if session.python == "3.12":
58+
dependencies.remove("duckdb")
59+
dependencies.remove("duckdb-engine")
60+
61+
5562
@session(python=main_python_version)
5663
def mypy(session: Session) -> None:
5764
"""Check types with mypy."""
@@ -77,6 +84,7 @@ def mypy(session: Session) -> None:
7784
@session(python=python_versions)
7885
def tests(session: Session) -> None:
7986
"""Execute pytest tests and compute coverage."""
87+
_clean_py312_deps(session, test_dependencies)
8088
session.install(".[s3,parquet]")
8189
session.install(*test_dependencies)
8290

@@ -107,6 +115,7 @@ def tests(session: Session) -> None:
107115
@session(python=main_python_version)
108116
def benches(session: Session) -> None:
109117
"""Run benchmarks."""
118+
_clean_py312_deps(session, test_dependencies)
110119
session.install(".[s3]")
111120
session.install(*test_dependencies)
112121
sqlalchemy_version = os.environ.get("SQLALCHEMY_VERSION")
@@ -129,6 +138,7 @@ def update_snapshots(session: Session) -> None:
129138
"""Update pytest snapshots."""
130139
args = session.posargs or ["-m", "snapshot"]
131140

141+
_clean_py312_deps(session, test_dependencies)
132142
session.install(".")
133143
session.install(*test_dependencies)
134144
session.run("pytest", "--snapshot-update", *args)

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ coverage = [
125125
{extras = ["toml"], version = ">=7.2,<7.3", python = "<3.8"},
126126
{extras = ["toml"], version = ">=7.2", python = ">=3.8"},
127127
]
128-
duckdb = ">=0.8.0"
129-
duckdb-engine = ">=0.9.2"
128+
129+
# TODO: Remove the Python 3.12 marker when DuckDB supports it
130+
duckdb = { version = ">=0.8.0", python = "<3.12" }
131+
duckdb-engine = { version = ">=0.9.2", python = "<3.12" }
132+
130133
mypy = [
131134
{ version = ">=1.0,<1.5", python = "<3.8" },
132135
{ version = ">=1.0", python = ">=3.8" },

tests/core/test_connector_sql.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

3+
import sys
34
import typing as t
45
from decimal import Decimal
56
from unittest import mock
67

78
import pytest
89
import sqlalchemy
910
from sqlalchemy.dialects import registry, sqlite
11+
from sqlalchemy.exc import NoSuchModuleError
1012

1113
from singer_sdk.connectors import SQLConnector
1214
from singer_sdk.exceptions import ConfigValidationError
@@ -308,6 +310,11 @@ def get_column_alter_ddl(
308310
)
309311

310312

313+
@pytest.mark.xfail(
314+
reason="DuckDB does not build on Python 3.12 yet",
315+
condition=sys.version_info >= (3, 12),
316+
raises=NoSuchModuleError,
317+
)
311318
class TestDuckDBConnector:
312319
@pytest.fixture
313320
def connector(self):

0 commit comments

Comments
 (0)