Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ all = [ # users can install duckdb with 'duckdb[all]', which will install this l
"fsspec", # used in duckdb.filesystem
"numpy", # used in duckdb.experimental.spark and in duckdb.fetchnumpy()
"pandas", # used for pandas dataframes all over the place
"pyarrow; python_version < '3.14'", # used for pyarrow support
"pyarrow", # used for pyarrow support
"adbc-driver-manager", # for the adbc driver
]

Expand Down Expand Up @@ -226,7 +226,7 @@ stubdeps = [ # dependencies used for typehints in the stubs
"fsspec",
"pandas",
"polars",
"pyarrow; python_version < '3.14'",
"pyarrow",
]
test = [ # dependencies used for running tests
"adbc-driver-manager",
Expand All @@ -248,7 +248,7 @@ test = [ # dependencies used for running tests
"urllib3",
"fsspec>=2022.11.0",
"pandas>=2.0.0",
"pyarrow>=18.0.0; python_version < '3.14'",
"pyarrow>=18.0.0",
"torch>=2.2.2; python_version < '3.14' and ( sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13' )",
"tensorflow==2.14.0; sys_platform == 'darwin' and python_version < '3.12'",
"tensorflow-cpu>=2.14.0; sys_platform == 'linux' and platform_machine != 'aarch64' and python_version < '3.12'",
Expand All @@ -265,7 +265,7 @@ scripts = [ # dependencies used for running scripts
"pandas",
"pcpp",
"polars",
"pyarrow; python_version < '3.14'",
"pyarrow",
"pytz"
]
pypi = [ # dependencies used by the pypi cleanup script
Expand Down
42 changes: 0 additions & 42 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
import warnings
from importlib import import_module
from pathlib import Path
Expand Down Expand Up @@ -36,47 +35,6 @@ def import_pandas():
pytest.skip("Couldn't import pandas")


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_call(item):
"""Convert missing pyarrow imports to skips.

TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
https://github.com/duckdblabs/duckdb-internal/issues/6182
"""
outcome = yield
if sys.version_info[:2] == (3, 14):
try:
outcome.get_result()
except ImportError as e:
if e.name == "pyarrow":
pytest.skip(f"pyarrow not available - {item.name} requires pyarrow")
else:
raise


@pytest.hookimpl(hookwrapper=True)
def pytest_make_collect_report(collector):
"""Wrap module collection to catch pyarrow import errors on Python 3.14.

If we're on Python 3.14 and a test module raises ModuleNotFoundError
for 'pyarrow', mark the entire module as xfailed rather than failing collection.

TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
https://github.com/duckdblabs/duckdb-internal/issues/6182
"""
outcome = yield
report: pytest.CollectReport = outcome.get_result()

if sys.version_info[:2] == (3, 14):
# Only handle failures from module collectors
if report.failed and collector.__class__.__name__ == "Module":
longreprtext = report.longreprtext
if "ModuleNotFoundError: No module named 'pyarrow'" in longreprtext:
report.outcome = "skipped"
reason = f"XFAIL: [pyarrow not available] {longreprtext}"
report.longrepr = (report.fspath, None, reason)


# https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option
# https://stackoverflow.com/a/47700320
def pytest_addoption(parser):
Expand Down
Loading