Skip to content

Commit

Permalink
XFail duckdb tests in Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 6, 2023
1 parent 507097c commit 1bb2f20
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
]


def _clean_py312_deps(session: Session, dependencies: list[str]) -> None:
"""Clean dependencies for Python 3.12."""
if session.python == "3.12":
dependencies.remove("duckdb")
dependencies.remove("duckdb-engine")


@session(python=main_python_version)
def mypy(session: Session) -> None:
"""Check types with mypy."""
Expand All @@ -77,6 +84,7 @@ def mypy(session: Session) -> None:
@session(python=python_versions)
def tests(session: Session) -> None:
"""Execute pytest tests and compute coverage."""
_clean_py312_deps(session, test_dependencies)
session.install(".[s3,parquet]")
session.install(*test_dependencies)

Expand Down Expand Up @@ -107,6 +115,7 @@ def tests(session: Session) -> None:
@session(python=main_python_version)
def benches(session: Session) -> None:
"""Run benchmarks."""
_clean_py312_deps(session, test_dependencies)
session.install(".[s3]")
session.install(*test_dependencies)
sqlalchemy_version = os.environ.get("SQLALCHEMY_VERSION")
Expand All @@ -129,6 +138,7 @@ def update_snapshots(session: Session) -> None:
"""Update pytest snapshots."""
args = session.posargs or ["-m", "snapshot"]

_clean_py312_deps(session, test_dependencies)
session.install(".")
session.install(*test_dependencies)
session.run("pytest", "--snapshot-update", *args)
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ coverage = [
{extras = ["toml"], version = ">=7.2,<7.3", python = "<3.8"},
{extras = ["toml"], version = ">=7.2", python = ">=3.8"},
]
duckdb = ">=0.8.0"
duckdb-engine = ">=0.9.2"

# TODO: Remove the Python 3.12 marker when DuckDB supports it
duckdb = { version = ">=0.8.0", python = "<3.12" }
duckdb-engine = { version = ">=0.9.2", python = "<3.12" }

mypy = [
{ version = ">=1.0,<1.5", python = "<3.8" },
{ version = ">=1.0", python = ">=3.8" },
Expand Down
7 changes: 7 additions & 0 deletions tests/core/test_connector_sql.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from __future__ import annotations

import sys
import typing as t
from decimal import Decimal
from unittest import mock

import pytest
import sqlalchemy
from sqlalchemy.dialects import registry, sqlite
from sqlalchemy.exc import NoSuchModuleError

from singer_sdk.connectors import SQLConnector
from singer_sdk.exceptions import ConfigValidationError
Expand Down Expand Up @@ -308,6 +310,11 @@ def get_column_alter_ddl(
)


@pytest.mark.xfail(
reason="DuckDB does not build on Python 3.12 yet",
condition=sys.version_info >= (3, 12),
raises=NoSuchModuleError,
)
class TestDuckDBConnector:
@pytest.fixture
def connector(self):
Expand Down

0 comments on commit 1bb2f20

Please sign in to comment.