Commit 1fb2a073 authored by Doron Behar's avatar Doron Behar
Browse files

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
parent 042538d5
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -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" ];