Skip to content

Commit

Permalink
test: Reference a duckdb version with wheels (#2206)
Browse files Browse the repository at this point in the history
A release was deleted from PYPI :/
  • Loading branch information
edgarrmondragon authored Jan 31, 2024
1 parent 4a4fddb commit 41ca39e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 42 deletions.
10 changes: 10 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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 @@ -79,6 +86,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 @@ -112,6 +120,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 @@ -134,6 +143,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
89 changes: 49 additions & 40 deletions poetry.lock

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

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ parquet = ["numpy", "pyarrow"]
[tool.poetry.group.dev.dependencies]
coverage = {extras = ["toml"], version = ">=7.4"}

duckdb = { version = ">=0.9.3.dev2490", allow-prereleases = true }
duckdb-engine = { version = ">=0.9.4" }
# TODO: Remove the Python 3.12 marker when DuckDB supports it
duckdb = { version = ">=0.8.0", python = "<3.12" }
duckdb-engine = { version = ">=0.9.4", python = "<3.12" }

mypy = ">=1.0"
pytest-benchmark = ">=4.0.0"
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 as sa
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 41ca39e

Please sign in to comment.