From 760d3ef661fbe2c828cfd066b41ab009758d4fb1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 24 Jan 2026 00:21:34 +0000 Subject: [PATCH] python3Packages.fast-array-utils: cleanup, add optional-dependencies --- .../fast-array-utils/default.nix | 86 +++++++++++++++++-- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/fast-array-utils/default.nix b/pkgs/development/python-modules/fast-array-utils/default.nix index 422e8b1ac0ea..4d3815c78c26 100644 --- a/pkgs/development/python-modules/fast-array-utils/default.nix +++ b/pkgs/development/python-modules/fast-array-utils/default.nix @@ -1,22 +1,48 @@ { + lib, buildPythonPackage, - dask, fetchFromGitHub, + + # build-system hatch-docstring-description, hatch-fancy-pypi-readme, hatch-min-requirements, hatch-vcs, hatchling, - lib, - numba, + + # dependencies numpy, + + # optional-dependencies + # accel + numba, + # dask + dask, + # doc + furo, + pytest, + sphinx, + sphinx-autodoc-typehints, + # full + h5py, + zarr, + # test + anndata, + numcodecs, + # test-min + coverage, pytest-codspeed, pytest-doctestplus, + pytest-xdist, + # testing + packaging, + + # tests pytestCheckHook, scipy, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "fast-array-utils"; version = "1.3.1"; pyproject = true; @@ -24,7 +50,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "scverse"; repo = "fast-array-utils"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-FUzCdDFDqP+izlSWruWzslfPayzRN7MFx1LOikyMDss="; }; @@ -43,6 +69,53 @@ buildPythonPackage rec { numpy ]; + optional-dependencies = lib.fix (self: { + accel = [ + numba + ]; + dask = [ + dask + ]; + doc = [ + furo + pytest + # scanpydoc + sphinx + sphinx-autodoc-typehints + # sphinx-autofixture + ]; + full = [ + h5py + zarr + ] + ++ self.accel + ++ self.dask + ++ self.sparse; + sparse = [ + scipy + ]; + test = [ + anndata + numcodecs + zarr + ] + ++ self.accel + ++ self.test-min; + test-min = [ + coverage + pytest + pytest-codspeed + pytest-doctestplus + pytest-xdist + ] + ++ coverage.optional-dependencies.toml + ++ self.sparse + ++ self.testing; + testing = [ + packaging + ]; + }); + nativeCheckInputs = [ dask numba @@ -62,9 +135,10 @@ buildPythonPackage rec { meta = { description = "Fast array utilities"; homepage = "https://icb-fast-array-utils.readthedocs-hosted.com"; + changelog = "https://github.com/scverse/fast-array-utils/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mpl20; maintainers = with lib.maintainers; [ samuela ]; }; -} +})