From afaaf934d2fab2f30ceca950b23d6d2ac1bbc4b7 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 14 Apr 2026 09:15:53 +0300 Subject: [PATCH 1/4] python3Packages.xarray: 2026.02.0 -> 2026.04.0 Diff: https://github.com/pydata/xarray/compare/v2026.02.0...v2026.04.0 Changelog: https://github.com/pydata/xarray/blob/v2026.04.0/doc/whats-new.rst --- pkgs/development/python-modules/xarray/default.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/xarray/default.nix b/pkgs/development/python-modules/xarray/default.nix index 823d1bcada2e..84b5816a76cc 100644 --- a/pkgs/development/python-modules/xarray/default.nix +++ b/pkgs/development/python-modules/xarray/default.nix @@ -37,14 +37,14 @@ buildPythonPackage rec { pname = "xarray"; - version = "2026.02.0"; + version = "2026.04.0"; pyproject = true; src = fetchFromGitHub { owner = "pydata"; repo = "xarray"; tag = "v${version}"; - hash = "sha256-g1cKI0Et3RToWOxn+bELtT5jAaB8e1N+k9doCU+OgfY="; + hash = "sha256-BsgL+Xo9fTMLLdz5AfScnKGuBa76cE85LuUzB4ZNLiY="; }; postPatch = '' @@ -99,12 +99,6 @@ buildPythonPackage rec { scipy ]; - disabledTestPaths = [ - # https://github.com/pydata/xarray/issues/11183 - "xarray/tests/test_dataarray.py::TestDataArray::test_curvefit_helpers" # Failed: DID NOT RAISE - "xarray/tests/test_variable.py::TestIndexVariable::test_concat_periods" # ValueError: Could not convert Size: 40B - ]; - pythonImportsCheck = [ "xarray" ]; meta = { From 91cbfa90ac180a9fbc3ad9548a7be006e77af2df Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 14 Apr 2026 09:30:26 +0300 Subject: [PATCH 2/4] python3Packages.xarray: use finalAttrs pattern --- .../python-modules/xarray/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/xarray/default.nix b/pkgs/development/python-modules/xarray/default.nix index 84b5816a76cc..94bf18a5de9f 100644 --- a/pkgs/development/python-modules/xarray/default.nix +++ b/pkgs/development/python-modules/xarray/default.nix @@ -35,7 +35,7 @@ pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "xarray"; version = "2026.04.0"; pyproject = true; @@ -43,7 +43,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pydata"; repo = "xarray"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-BsgL+Xo9fTMLLdz5AfScnKGuBa76cE85LuUzB4ZNLiY="; }; @@ -63,7 +63,7 @@ buildPythonPackage rec { pandas ]; - optional-dependencies = lib.fix (self: { + optional-dependencies = { accel = [ bottleneck # flox @@ -90,8 +90,10 @@ buildPythonPackage rec { # nc-time-axis seaborn ]; - complete = with self; accel ++ io ++ etc ++ parallel ++ viz; - }); + complete = + with finalAttrs.finalPackage.passthru.optional-dependencies; + accel ++ io ++ etc ++ parallel ++ viz; + }; nativeCheckInputs = [ pytest-asyncio @@ -102,7 +104,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "xarray" ]; meta = { - changelog = "https://github.com/pydata/xarray/blob/${src.tag}/doc/whats-new.rst"; + changelog = "https://github.com/pydata/xarray/blob/${finalAttrs.src.tag}/doc/whats-new.rst"; description = "N-D labeled arrays and datasets in Python"; homepage = "https://github.com/pydata/xarray"; license = lib.licenses.asl20; @@ -110,4 +112,4 @@ buildPythonPackage rec { doronbehar ]; }; -} +}) From 042538d5cf0b9fd1fd2e1ac0c665331fe1074abe Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 14 Apr 2026 11:58:18 +0300 Subject: [PATCH 3/4] python3Packages.h5py: inherit hdf5 in passthru --- pkgs/development/python-modules/h5py/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix index b0ab2fc32af4..0adb77a037ef 100644 --- a/pkgs/development/python-modules/h5py/default.nix +++ b/pkgs/development/python-modules/h5py/default.nix @@ -79,6 +79,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "h5py" ]; + passthru = { + # To evaluate more easily *Support flags of it from within Python Packages. + inherit hdf5; + }; + meta = { changelog = "https://github.com/h5py/h5py/blob/${version}/docs/whatsnew/${lib.versions.majorMinor version}.rst"; description = "Pythonic interface to the HDF5 binary data format"; From 1fb2a0732be7153306226663e57a31b812983377 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 14 Apr 2026 09:32:40 +0300 Subject: [PATCH 4/4] python3Packages.xarray: collect more tests with optional-dependencies The test session log said before this commit: collected 16599 items / 16 skipped And it had many `sss` letters. Now we have less `s` letters and: collected 21087 items / 10 skipped --- .../python-modules/xarray/default.nix | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/xarray/default.nix b/pkgs/development/python-modules/xarray/default.nix index 94bf18a5de9f..6bc6e731ce2b 100644 --- a/pkgs/development/python-modules/xarray/default.nix +++ b/pkgs/development/python-modules/xarray/default.nix @@ -33,12 +33,15 @@ # tests pytest-asyncio, pytestCheckHook, + h5py, }: buildPythonPackage (finalAttrs: { pname = "xarray"; version = "2026.04.0"; pyproject = true; + # Needed mainly for pytestFlags with spaces + __structuredAttrs = true; src = fetchFromGitHub { owner = "pydata"; @@ -98,7 +101,22 @@ buildPythonPackage (finalAttrs: { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - scipy + ] + # Besides scipy, these are not strictly needed for the tests, but adding all + # of these optional-dependencies extends the amount of tests from ~17k to + # ~21k. + ++ finalAttrs.finalPackage.optional-dependencies.io + ++ finalAttrs.finalPackage.optional-dependencies.accel + ++ finalAttrs.finalPackage.optional-dependencies.etc + ++ finalAttrs.finalPackage.optional-dependencies.parallel + # Not adding optional-dependencies.viz because adding cartopy causes infinite + # recursion, and doesn't cause more tests to be collected. + ; + pytestFlags = lib.optionals (!h5py.hdf5.szipSupport) [ + "-k" + # Our h5py is built with hdf5 that is built without szip support, so we + # skip these tests + "not szip" ]; pythonImportsCheck = [ "xarray" ];