Skip to content

Commit 8195839

Browse files
mattijncclauss
andauthored
ci: include python 3.14 rc3 to the GitHub action matrix (#3876)
* include py3.14rc3 * Update build.yml Co-authored-by: Christian Clauss <[email protected]> * Update pyproject.toml Co-authored-by: Christian Clauss <[email protected]> * skip geopandas for pyhton 3.14 * skip tests that involve duckdb if not installed * ruff changes * remove py3.14t (threaded variant) for now --------- Co-authored-by: Christian Clauss <[email protected]>
1 parent d9ce7ab commit 8195839

File tree

6 files changed

+1912
-1870
lines changed

6 files changed

+1912
-1870
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1414
required-dependencies: ["minimum", "latest"]
15+
1516
name: py ${{ matrix.python-version }} with ${{ matrix.required-dependencies }} required deps
1617
steps:
1718
- uses: actions/checkout@v5

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ all = [
6969
dev = [
7070
"hatch>=1.13.0",
7171
"ruff>=0.9.5",
72-
"duckdb>=1.0",
72+
"duckdb>=1.0; python_version<\"3.14\"",
7373
"ipython",
7474
"ipykernel",
7575
"pandas>=1.1.3",
@@ -82,7 +82,7 @@ dev = [
8282
"pandas-stubs",
8383
"types-jsonschema",
8484
"types-setuptools",
85-
"geopandas",
85+
"geopandas>=0.14.3; python_version<\"3.14\"",
8686
"polars>=0.20.3",
8787
"taskipy>=1.14.1",
8888
"tomli>=2.2.1",
@@ -127,7 +127,7 @@ doc = { features = ["all", "dev", "doc"] }
127127
[tool.hatch.envs.hatch-test]
128128
# https://hatch.pypa.io/latest/tutorials/testing/overview/
129129
features = ["all", "dev", "doc"]
130-
matrix = [{ python = ["3.9", "3.10", "3.11", "3.12", "3.13"] }]
130+
matrix = [{ python = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] }]
131131

132132
[tool.ruff]
133133
extend-exclude = [
@@ -319,7 +319,8 @@ addopts = [
319319
markers = [
320320
"slow: Label tests as slow (deselect with '-m \"not slow\"')",
321321
"datasets_debug: Disabled by default due to high number of requests",
322-
"no_xdist: Unsafe to run in parallel"
322+
"no_xdist: Unsafe to run in parallel",
323+
"geospatial: Tests that require geopandas (deselect with '-m \"not geospatial\"')"
323324
]
324325

325326
[tool.mypy]

tests/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,30 @@ def windows_has_tzdata() -> bool:
112112
find_spec("scipy") is None, reason="`scipy` not installed."
113113
)
114114

115+
skip_requires_geopandas: pytest.MarkDecorator = pytest.mark.skipif(
116+
find_spec("geopandas") is None, reason="`geopandas` not installed."
117+
)
118+
"""
119+
``pytest.mark.skipif`` decorator.
120+
121+
Applies when `geopandas`_ import would fail.
122+
123+
.. _geopandas:
124+
https://geopandas.org/
125+
"""
126+
127+
skip_requires_duckdb: pytest.MarkDecorator = pytest.mark.skipif(
128+
find_spec("duckdb") is None, reason="`duckdb` not installed."
129+
)
130+
"""
131+
``pytest.mark.skipif`` decorator.
132+
133+
Applies when `duckdb`_ import would fail.
134+
135+
.. _duckdb:
136+
https://duckdb.org/
137+
"""
138+
115139

116140
@overload
117141
def skip_requires_pyarrow(

tests/test_datasets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from altair.datasets import Loader
1818
from altair.datasets._exceptions import AltairDatasetsError
1919
from altair.datasets._typing import Dataset, Metadata
20-
from tests import no_xdist, skip_requires_pyarrow
20+
from tests import no_xdist, skip_requires_geopandas, skip_requires_pyarrow
2121

2222
if TYPE_CHECKING:
2323
from collections.abc import Mapping
@@ -548,6 +548,8 @@ def test_pyarrow_read_json(
548548

549549
@datasets_spatial
550550
@backends_no_polars
551+
@pytest.mark.geospatial
552+
@skip_requires_geopandas
551553
def test_spatial(backend: _Backend, name: Dataset) -> None:
552554
load = Loader.from_backend(backend)
553555

tests/vegalite/v6/test_api.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from importlib.util import find_spec
1818
from typing import TYPE_CHECKING
1919

20-
import duckdb
2120
import jsonschema
2221
import narwhals.stable.v1 as nw
2322
import pandas as pd
@@ -28,11 +27,18 @@
2827
import altair as alt
2928
from altair.utils.core import use_signature
3029
from altair.utils.schemapi import Optional, SchemaValidationError, Undefined
31-
from tests import skip_requires_pyarrow, skip_requires_vl_convert, slow
30+
from tests import (
31+
skip_requires_duckdb,
32+
skip_requires_pyarrow,
33+
skip_requires_vl_convert,
34+
slow,
35+
)
3236

3337
if TYPE_CHECKING:
3438
from typing import Any
3539

40+
import duckdb
41+
3642
from altair.vegalite.v6.api import _Conditional, _Conditions
3743
from altair.vegalite.v6.schema._typing import Map
3844

@@ -1824,9 +1830,12 @@ def test_polars_date_32():
18241830

18251831

18261832
@skip_requires_pyarrow(requires_tzdata=True)
1833+
@skip_requires_duckdb
18271834
def test_interchange_with_date_32():
18281835
# Test that objects which Narwhals only supports at the interchange
18291836
# level can be plotted when they contain date32 columns.
1837+
import duckdb
1838+
18301839
df = pl.DataFrame( # noqa: F841
18311840
{"a": [1, 2, 3], "b": [date(2020, 1, 1), date(2020, 1, 2), date(2020, 1, 3)]}
18321841
)
@@ -1840,13 +1849,16 @@ def test_interchange_with_date_32():
18401849

18411850

18421851
@skip_requires_pyarrow(requires_tzdata=True)
1852+
@skip_requires_duckdb
18431853
def test_interchange_with_vegafusion(monkeypatch: pytest.MonkeyPatch):
18441854
# Test that objects which Narwhals only supports at the interchange
18451855
# level don't get converted to PyArrow unnecessarily when plotted
18461856
# with the vegafusion transformer.
18471857
# TODO: this test can be drastically simplified when some level of
18481858
# DuckDB support in VegaFusion, as it can then just be `alt.Chart(rel_df)`
18491859
# without DuckDBWithInterchangeSupport.
1860+
import duckdb
1861+
18501862
df = pl.DataFrame( # noqa: F841
18511863
{
18521864
"a": [1, 2, 3],

0 commit comments

Comments
 (0)