From 0515e4e0f144f593b3a9150d009dc1ad5c39c184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 22 Jun 2026 17:08:31 +0200 Subject: [PATCH] python314Packages.xarray: add pytest-xdist to speed up tests by 2x --- pkgs/development/python-modules/xarray/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/xarray/default.nix b/pkgs/development/python-modules/xarray/default.nix index 6bc6e731ce2b..b0e9e537cd56 100644 --- a/pkgs/development/python-modules/xarray/default.nix +++ b/pkgs/development/python-modules/xarray/default.nix @@ -7,7 +7,7 @@ setuptools, setuptools-scm, - # dependenices + # dependencies numpy, packaging, pandas, @@ -32,6 +32,7 @@ # tests pytest-asyncio, + pytest-xdist, pytestCheckHook, h5py, }: @@ -98,8 +99,14 @@ buildPythonPackage (finalAttrs: { accel ++ io ++ etc ++ parallel ++ viz; }; + preCheck = '' + # tests become flaky with to many cores + export NIX_BUILD_CORES=$((NIX_BUILD_CORES > 8 ? 8 : NIX_BUILD_CORES)) + ''; + nativeCheckInputs = [ pytest-asyncio + pytest-xdist pytestCheckHook ] # Besides scipy, these are not strictly needed for the tests, but adding all