commit: bb869051a05f492b64832762e6c51c742e345f45 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Tue May 6 04:57:03 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Tue May 6 05:28:54 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb869051
dev-python/narwhals: Bump to 1.38.0 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> dev-python/narwhals/Manifest | 1 + .../files/narwhals-1.38.0-opt-polars.patch | 32 +++++++++++++++ dev-python/narwhals/narwhals-1.38.0.ebuild | 46 ++++++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/dev-python/narwhals/Manifest b/dev-python/narwhals/Manifest index d9ecfa149a12..dfc093181031 100644 --- a/dev-python/narwhals/Manifest +++ b/dev-python/narwhals/Manifest @@ -1 +1,2 @@ DIST narwhals-1.37.1.gh.tar.gz 708868 BLAKE2B 0cda4e6febb2407b12db34068ba5419cfacc2003a6e4c9a62f713db8ab9994128ac6a739d09a8eb40ab543eb689c3867f3069841f761786a221eff5ef1b37b39 SHA512 3aeb15341f525397aff4ca389cafcdce3b433c0cdd7d0ad389592cfaf0c3837019660895b3a52923b84ce4f2b3f9d29670a962dcd5687dca1a4fe99977e49e20 +DIST narwhals-1.38.0.gh.tar.gz 714872 BLAKE2B f60b828c20849866ac2b0a48a4d3cdd21c80c1f2d48beb1cfe1f519e09f9ea7e045ab3824de886a880e3e5385786e73208bc69a6bd8c1c06b94c3161f3be4d6c SHA512 668f57d7830d70992477f5ac7d917abaf95b36ade8c0b60c93d1ed6eb5f4aa892c83812aedd5056b32d6498d727804d835d880ddc41a2e6a0630fee05e30e581 diff --git a/dev-python/narwhals/files/narwhals-1.38.0-opt-polars.patch b/dev-python/narwhals/files/narwhals-1.38.0-opt-polars.patch new file mode 100644 index 000000000000..96de66908a42 --- /dev/null +++ b/dev-python/narwhals/files/narwhals-1.38.0-opt-polars.patch @@ -0,0 +1,32 @@ +From add7beafc8394ae76309bcb93443aee840d8e5f0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]> +Date: Tue, 6 May 2025 07:12:45 +0200 +Subject: [PATCH] test: make `polars` optional in `truncate_test` + +--- + tests/expr_and_series/dt/truncate_test.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/expr_and_series/dt/truncate_test.py b/tests/expr_and_series/dt/truncate_test.py +index 3e51a796..d2a2e960 100644 +--- a/tests/expr_and_series/dt/truncate_test.py ++++ b/tests/expr_and_series/dt/truncate_test.py +@@ -3,7 +3,6 @@ from __future__ import annotations + from datetime import datetime + + import pandas as pd +-import polars as pl + import pytest + + import narwhals as nw +@@ -227,6 +226,10 @@ def test_truncate_custom( + ], + ) + def test_truncate_polars_ns(every: str, expected: list[datetime]) -> None: ++ pytest.importorskip("polars") ++ ++ import polars as pl ++ + df_pl = pl.DataFrame(data, schema={"a": pl.Datetime(time_unit="ns")}) + df = nw.from_native(df_pl) + result = df.select(nw.col("a").dt.truncate(every)) diff --git a/dev-python/narwhals/narwhals-1.38.0.ebuild b/dev-python/narwhals/narwhals-1.38.0.ebuild new file mode 100644 index 000000000000..a5895f097c1e --- /dev/null +++ b/dev-python/narwhals/narwhals-1.38.0.ebuild @@ -0,0 +1,46 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( python3_{11..13} ) + +inherit distutils-r1 + +DESCRIPTION="Extremely lightweight compatibility layer between dataframe libraries" +HOMEPAGE=" + https://github.com/narwhals-dev/narwhals/ + https://pypi.org/project/narwhals/ +" +# https://github.com/narwhals-dev/narwhals/issues/2284 +SRC_URI=" + https://github.com/narwhals-dev/narwhals/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +BDEPEND=" + test? ( + dev-python/hypothesis[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + dev-python/pyarrow[${PYTHON_USEDEP}] + dev-python/pytest-env[${PYTHON_USEDEP}] + ) +" + +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/narwhals-dev/narwhals/pull/2501 + "${FILESDIR}/${P}-opt-polars.patch" +) + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest --runslow --constructors="pandas,pandas[nullable],pandas[pyarrow],pyarrow" +}
