From 760d3ef661fbe2c828cfd066b41ab009758d4fb1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 24 Jan 2026 00:21:34 +0000 Subject: [PATCH 1/2] 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 ]; }; -} +}) From ddcb01a922d64c9cafb95ee296fa14749fdd3da7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 24 Jan 2026 00:08:49 +0000 Subject: [PATCH 2/2] python3Packages.scanpy: 1.11.5 -> 1.12.0 Diff: https://github.com/scverse/scanpy/compare/1.11.5...1.12.0 Changelog: https://github.com/scverse/scanpy/releases/tag/1.12.0 --- .../python-modules/scanpy/default.nix | 81 +++++++++++++++---- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/scanpy/default.nix b/pkgs/development/python-modules/scanpy/default.nix index 133513e646ad..88b1f4c7f624 100644 --- a/pkgs/development/python-modules/scanpy/default.nix +++ b/pkgs/development/python-modules/scanpy/default.nix @@ -2,9 +2,14 @@ lib, buildPythonPackage, fetchFromGitHub, + + # build-system hatch-vcs, hatchling, + + # dependencies anndata, + fast-array-utils, h5py, joblib, legacy-api-wrap, @@ -25,35 +30,54 @@ tqdm, typing-extensions, umap-learn, - dask, - dask-ml, + # optional-attrs + # dask + dask, + # dask-ml + dask-ml, + # leiden igraph, leidenalg, + # scrublet scikit-image, + # skmisc scikit-misc, - zarr, - pytestCheckHook, + + # tests + jinja2, pytest-cov-stub, pytest-mock, pytest-randomly, pytest-rerunfailures, pytest-xdist, + pytestCheckHook, tuna, + writableTmpDirAsHomeHook, + zarr, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "scanpy"; - version = "1.11.5"; + version = "1.12.0"; pyproject = true; src = fetchFromGitHub { owner = "scverse"; repo = "scanpy"; - tag = version; - hash = "sha256-GnZ1qJ4SaTLDzfLAH6IHrYeuMBo8PglKUlj4f3ljeR0="; + tag = finalAttrs.version; + hash = "sha256-jpi3SyTaG5mxCqUNSM564MMIrNdz4LBYo9+dn5nYmeY="; }; + # Otherwise, several tests fail to be collected: + # AssertionError: scanpy is already imported, this will mess up test coverage + postPatch = '' + substituteInPlace src/testing/scanpy/_pytest/__init__.py \ + --replace-fail \ + 'assert "scanpy" not in sys.modules,' \ + 'assert True,' + ''; + build-system = [ hatch-vcs hatchling @@ -61,6 +85,7 @@ buildPythonPackage rec { dependencies = [ anndata + fast-array-utils h5py joblib legacy-api-wrap @@ -81,7 +106,9 @@ buildPythonPackage rec { tqdm typing-extensions umap-learn - ]; + ] + ++ fast-array-utils.optional-dependencies.accel + ++ fast-array-utils.optional-dependencies.sparse; optional-dependencies = { # commented attributes are due to some dependencies not being in Nixpkgs @@ -129,13 +156,15 @@ buildPythonPackage rec { }; nativeCheckInputs = [ - pytestCheckHook + jinja2 pytest-cov-stub pytest-mock pytest-randomly pytest-rerunfailures pytest-xdist + pytestCheckHook tuna + writableTmpDirAsHomeHook zarr ]; @@ -151,35 +180,57 @@ buildPythonPackage rec { "tests/test_pca.py" "tests/test_plotting.py" "tests/test_plotting_embedded/" + + # fixture 'backed_adata' not found + "tests/test_backed.py" ]; disabledTests = [ # try to download data: "scanpy.get._aggregated.aggregate" "scanpy.plotting._tools.scatterplots.spatial" + "test_burczynski06" "test_clip" + "test_doc_shape" "test_download_failure" + "test_ebi_expression_atlas" "test_mean_var" + "test_paul15" + "test_pbmc3k" + "test_pbmc3k_processed" "test_regress_out_int" "test_score_with_reference" + "test_visium_datasets" + "test_visium_datasets_dir_change" + "test_visium_datasets_images" # fails to find the trivial test script for some reason: "test_external" + # fixture 'original_settings' not found + "test_defaults" + # AssertionError: Not equal to tolerance rtol=1e-07, atol=0 "test_connectivities_euclidean" + + # assert sc.settings.autoshow + # AssertionError: assert False + "test_resets" + + # FileNotFoundError: [Errno 2] Unable to synchronously create file (unable to open file: name = + # 'write/test.h5ad', errno = 2, error message = 'No such file or directory', flags = 13, o_flags + # = 242) + "test_write" ]; - pythonImportsCheck = [ - "scanpy" - ]; + pythonImportsCheck = [ "scanpy" ]; meta = { description = "Single-cell analysis in Python which scales to >100M cells"; homepage = "https://scanpy.readthedocs.io"; - changelog = "https://github.com/scverse/scanpy/releases/tag/${src.tag}"; + changelog = "https://github.com/scverse/scanpy/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ bcdarwin ]; mainProgram = "scanpy"; }; -} +})