Skip to content

Commit aa3d0ad

Browse files
committed
3.14 support
1 parent cb1a499 commit aa3d0ad

7 files changed

Lines changed: 57 additions & 16 deletions

File tree

.github/workflows/cleanup_pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ jobs:
5050
exit 1
5151
5252
- name: Install Astral UV
53-
uses: astral-sh/setup-uv@v6
53+
uses: astral-sh/setup-uv@v7
5454
with:
55-
version: "0.7.14"
55+
version: "0.9.0"
5656

5757
- name: Run Cleanup
5858
env:

.github/workflows/code_quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
persist-credentials: false
3030

3131
- name: Install Astral UV
32-
uses: astral-sh/setup-uv@v6
32+
uses: astral-sh/setup-uv@v7
3333
with:
34-
version: "0.7.14"
34+
version: "0.9.0"
3535
python-version: 3.9
3636

3737
- name: pre-commit (cache)

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ jobs:
6868
sudo apt-get -y install ccache
6969
7070
- name: Install Astral UV and enable the cache
71-
uses: astral-sh/setup-uv@v6
71+
uses: astral-sh/setup-uv@v7
7272
with:
73-
version: "0.7.14"
73+
version: "0.9.0"
7474
python-version: 3.9
7575
enable-cache: true
7676
cache-suffix: -${{ github.workflow }}

.github/workflows/packaging_sdist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
run: echo "OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}" >> $GITHUB_ENV
5757

5858
- name: Install Astral UV
59-
uses: astral-sh/setup-uv@v6
59+
uses: astral-sh/setup-uv@v7
6060
with:
61-
version: "0.7.14"
61+
version: "0.9.0"
6262
python-version: 3.11
6363

6464
- name: Build sdist

.github/workflows/packaging_wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python: [ cp39, cp310, cp311, cp312, cp313 ]
33+
python: [ cp39, cp310, cp311, cp312, cp313, cp314 ]
3434
platform:
3535
- { os: windows-2025, arch: amd64, cibw_system: win }
3636
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
@@ -78,9 +78,9 @@ jobs:
7878
run: echo "CIBW_ENVIRONMENT=OVERRIDE_GIT_DESCRIBE=${{ inputs.set-version }}" >> $GITHUB_ENV
7979

8080
# Install Astral UV, which will be used as build-frontend for cibuildwheel
81-
- uses: astral-sh/setup-uv@v6
81+
- uses: astral-sh/setup-uv@v7
8282
with:
83-
version: "0.7.14"
83+
version: "0.9.0"
8484
enable-cache: false
8585
cache-suffix: -${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
8686

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ all = [ # users can install duckdb with 'duckdb[all]', which will install this l
4747
"fsspec", # used in duckdb.filesystem
4848
"numpy", # used in duckdb.experimental.spark and in duckdb.fetchnumpy()
4949
"pandas", # used for pandas dataframes all over the place
50-
"pyarrow", # used for pyarrow support
50+
"pyarrow; python_version < '3.14'", # used for pyarrow support
5151
"adbc-driver-manager", # for the adbc driver
5252
]
5353

@@ -226,7 +226,7 @@ stubdeps = [ # dependencies used for typehints in the stubs
226226
"fsspec",
227227
"pandas",
228228
"polars",
229-
"pyarrow",
229+
"pyarrow; python_version < '3.14'",
230230
]
231231
test = [ # dependencies used for running tests
232232
"adbc-driver-manager",
@@ -248,8 +248,8 @@ test = [ # dependencies used for running tests
248248
"urllib3",
249249
"fsspec>=2022.11.0",
250250
"pandas>=2.0.0",
251-
"pyarrow>=18.0.0",
252-
"torch>=2.2.2; sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13'",
251+
"pyarrow>=18.0.0; python_version < '3.14'",
252+
"torch>=2.2.2; python_version < '3.14' and ( sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13' )",
253253
"tensorflow==2.14.0; sys_platform == 'darwin' and python_version < '3.12'",
254254
"tensorflow-cpu>=2.14.0; sys_platform == 'linux' and platform_machine != 'aarch64' and python_version < '3.12'",
255255
"tensorflow-cpu>=2.14.0; sys_platform == 'win32' and python_version < '3.12'",
@@ -265,7 +265,7 @@ scripts = [ # dependencies used for running scripts
265265
"pandas",
266266
"pcpp",
267267
"polars",
268-
"pyarrow",
268+
"pyarrow; python_version < '3.14'",
269269
"pytz"
270270
]
271271
pypi = [ # dependencies used by the pypi cleanup script

tests/conftest.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import warnings
34
from importlib import import_module
45
from pathlib import Path
@@ -35,6 +36,46 @@ def import_pandas():
3536
pytest.skip("Couldn't import pandas")
3637

3738

39+
@pytest.hookimpl(hookwrapper=True)
40+
def pytest_runtest_call(item):
41+
"""Convert missing pyarrow imports to skips.
42+
43+
TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
44+
https://github.com/duckdblabs/duckdb-internal/issues/6182
45+
"""
46+
outcome = yield
47+
if sys.version_info[:2] == (3, 14):
48+
try:
49+
outcome.get_result()
50+
except ImportError as e:
51+
if e.name == "pyarrow":
52+
pytest.skip(f"pyarrow not available - {item.name} requires pyarrow")
53+
else:
54+
raise
55+
56+
57+
@pytest.hookimpl(hookwrapper=True)
58+
def pytest_make_collect_report(collector):
59+
"""Wrap module collection to catch pyarrow import errors on Python 3.14.
60+
61+
If we're on Python 3.14 and a test module raises ModuleNotFoundError
62+
for 'pyarrow', mark the entire module as xfailed rather than failing collection.
63+
64+
TODO(evertlammerts): Remove skip when pyarrow releases for 3.14.
65+
https://github.com/duckdblabs/duckdb-internal/issues/6182
66+
"""
67+
outcome = yield
68+
result = outcome.get_result()
69+
70+
if sys.version_info[:2] == (3, 14):
71+
# Only handle failures from module collectors
72+
if result.failed and collector.__class__.__name__ == "Module":
73+
longrepr = str(result.longrepr)
74+
if "ModuleNotFoundError: No module named 'pyarrow'" in longrepr:
75+
result.outcome = "skipped"
76+
result.longrepr = f"XFAIL: pyarrow not available {collector.name} ({longrepr.strip()})"
77+
78+
3879
# https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option
3980
# https://stackoverflow.com/a/47700320
4081
def pytest_addoption(parser):

0 commit comments

Comments
 (0)