Yueh-Shun Li 76e2a397c2 treewide: pytestFlagsArray -> pytestFlags and join flag and option argument
This treewide change targets Python packages
that specifies pytest flags with pytestFlagsArray,
and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.

Use the __structuredAttrs-agnostic argument pytestFlags
instead of the deprecated pytestFlagsArray.

For flags with option arguments,
join each flag and their option argument into a single command-line argument
following POSIX Utility Argument Syntax[1]
for easier overriding (remove/replace).

Examples:

* [ "-W" "ignore:message:WarningClass" ] ->
  [ "-Wignore:message:WarningClass" ]

* [ "--reruns" "3" ] ->
  [ "--reruns=3" ]

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
2025-06-16 01:02:16 +08:00

84 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
dask,
duckdb,
fetchFromGitHub,
hatchling,
hypothesis,
ibis-framework,
packaging,
pandas,
polars,
pyarrow-hotfix,
pyarrow,
pyspark,
pytest-env,
pytestCheckHook,
rich,
sqlframe,
}:
buildPythonPackage rec {
pname = "narwhals";
version = "1.40.0";
pyproject = true;
src = fetchFromGitHub {
owner = "narwhals-dev";
repo = "narwhals";
tag = "v${version}";
hash = "sha256-cCgWKH4DzENTI1vwxOU+GRp/poUe55XqSPY8UHYy9PI=";
};
build-system = [ hatchling ];
optional-dependencies = {
# cudf = [ cudf ];
dask = [ dask ] ++ dask.optional-dependencies.dataframe;
# modin = [ modin ];
pandas = [ pandas ];
polars = [ polars ];
pyarrow = [ pyarrow ];
pyspark = [ pyspark ];
ibis = [
ibis-framework
rich
packaging
pyarrow-hotfix
];
sqlframe = [ sqlframe ];
};
nativeCheckInputs = [
duckdb
hypothesis
pytest-env
pytestCheckHook
] ++ lib.flatten (builtins.attrValues optional-dependencies);
pythonImportsCheck = [ "narwhals" ];
disabledTests = [
# Flaky
"test_rolling_var_hypothesis"
# Missing file
"test_pyspark_connect_deps_2517"
# Timezone issue
"test_to_datetime"
"test_unary_two_elements"
];
pytestFlags = [
"-Wignore::DeprecationWarning"
];
meta = {
description = "Lightweight and extensible compatibility layer between dataframe libraries";
homepage = "https://github.com/narwhals-dev/narwhals";
changelog = "https://github.com/narwhals-dev/narwhals/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
}