This is an automated email from the ASF dual-hosted git repository. skrawcz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/hamilton.git
commit 45c128925837bdd70829aa244b46da7062e96671 Author: Josh Markovic <[email protected]> AuthorDate: Thu Jan 22 23:05:08 2026 -0500 Add conditional installs --- pyproject.toml | 22 +++++++++++----------- tests/conftest.py | 25 +++++++++++++++++++++++++ tests/plugins/test_pandas_extensions.py | 4 ++++ 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b44461b..79ffe7a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ pyspark = [ # we have to run these dependencies because Spark does not check to ensure the right target was called "pyspark[pandas_on_spark,sql]", ] -ray = ["ray>=2.0.0", "pyarrow"] +ray = ["ray>=2.0.0; python_version < '3.14'", "pyarrow"] rich = ["rich"] sdk = ["sf-hamilton-sdk"] slack = ["slack-sdk"] @@ -94,7 +94,7 @@ dev = [ "ruff==0.5.7", # this should match `.pre-commit-config.yaml` ] test = [ - "connectorx", + "connectorx; python_version < '3.14'", "dask[complete]", "dask-expr>=1.1.14", "datasets>=2.18.0", # huggingface datasets -- https://github.com/huggingface/datasets/issues/6737#issuecomment-2107336816 @@ -102,22 +102,22 @@ test = [ "dlt", "fsspec", "graphviz", - "kaleido", - "kedro", - "lancedb", - "lightgbm", + "kaleido; python_version < '3.14'", + "kedro; python_version < '3.14'", + "lancedb; python_version < '3.14'", + "lightgbm; python_version < '3.14'", "lxml", "lz4", "matplotlib", - "mlflow", + "mlflow; python_version <= '3.13'", "networkx", "openpyxl", # for excel data loader "pandera[dask]", - "plotly", - "polars", + "plotly; python_version < '3.14'", + "polars; python_version < '3.14'", "pyarrow", "pydantic >=2.0", - "pyreadstat", # for SPSS data loader + "pyreadstat; python_version < '3.14'", # for SPSS data loader "pytest", "pytest-asyncio", "pytest-cov", @@ -125,7 +125,7 @@ test = [ "scikit-learn", "sqlalchemy", "typer", - "xgboost", + "xgboost; python_version < '3.14'", "xlsx2csv", # for excel data loader "xlsxwriter", # Excel export requires 'xlsxwriter' ] diff --git a/tests/conftest.py b/tests/conftest.py index b131ad9a..f3549b9a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,7 +15,32 @@ # specific language governing permissions and limitations # under the License. +import sys + from hamilton import telemetry # disable telemetry for all tests! telemetry.disable_telemetry() + +# Skip tests that require packages not yet available on Python 3.14 +collect_ignore = [] +if sys.version_info >= (3, 14): + collect_ignore.extend([ + # polars - no Python 3.14 support yet + "plugins/test_polars_extensions.py", + "plugins/test_polars_lazyframe_extensions.py", + "resources/narwhals_example.py", + # plotly - no Python 3.14 support yet + "plugins/test_plotly_extensions.py", + # xgboost - no Python 3.14 support yet + "plugins/test_xgboost_extensions.py", + # lightgbm - no Python 3.14 support yet + "plugins/test_lightgbm_extensions.py", + # mlflow - no Python 3.14 support yet + "plugins/test_mlflow_extension.py", + # kedro - no Python 3.14 support yet + "plugins/test_h_kedro.py", + "plugins/test_kedro_extensions.py", + # lancedb - no Python 3.14 support yet + "plugins/test_huggingface_extensions.py", + ]) diff --git a/tests/plugins/test_pandas_extensions.py b/tests/plugins/test_pandas_extensions.py index 244108a1..51fb1943 100644 --- a/tests/plugins/test_pandas_extensions.py +++ b/tests/plugins/test_pandas_extensions.py @@ -18,6 +18,7 @@ import os import pathlib import sqlite3 +import sys from typing import Union from unittest import mock @@ -321,6 +322,9 @@ def test_pandas_table_reader(tmp_path: pathlib.Path) -> None: ] [email protected]( + sys.version_info >= (3, 14), reason="pyreadstat not available on Python 3.14" +) def test_pandas_spss_reader(tmp_path: pathlib.Path) -> None: import pyreadstat
