From 3bd110ed33ebf5f62b5a8107e450382f4bf45ead Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Wed, 13 Aug 2025 15:18:56 -0400 Subject: [PATCH] python313Packages.scanpy: init at 1.11.4 --- .../python-modules/scanpy/default.nix | 182 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 184 insertions(+) create mode 100644 pkgs/development/python-modules/scanpy/default.nix diff --git a/pkgs/development/python-modules/scanpy/default.nix b/pkgs/development/python-modules/scanpy/default.nix new file mode 100644 index 000000000000..44d3f8488279 --- /dev/null +++ b/pkgs/development/python-modules/scanpy/default.nix @@ -0,0 +1,182 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatch-vcs, + hatchling, + anndata, + h5py, + joblib, + legacy-api-wrap, + matplotlib, + natsort, + networkx, + numba, + numpy, + packaging, + pandas, + patsy, + pynndescent, + scikit-learn, + scipy, + seaborn, + session-info2, + statsmodels, + tqdm, + typing-extensions, + umap-learn, + dask, + dask-ml, + + igraph, + leidenalg, + scikit-image, + scikit-misc, + zarr, + pytestCheckHook, + pytest-cov-stub, + pytest-mock, + pytest-randomly, + pytest-rerunfailures, + pytest-xdist, + tuna, +}: + +buildPythonPackage rec { + pname = "scanpy"; + version = "1.11.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "scverse"; + repo = "scanpy"; + tag = version; + hash = "sha256-EvNelorfLOpYLGGZ1RSq4+jk6emuCWCKBdUop24iLf4="; + }; + + build-system = [ + hatch-vcs + hatchling + ]; + + dependencies = [ + anndata + h5py + joblib + legacy-api-wrap + matplotlib + natsort + networkx + numba + numpy + packaging + pandas + patsy + pynndescent + scikit-learn + scipy + seaborn + session-info2 + statsmodels + tqdm + typing-extensions + umap-learn + ]; + + optional-dependencies = { + # commented attributes are due to some dependencies not being in Nixpkgs + #bbknn = [ + # bbknn + #]; + dask = [ + anndata + dask + ]; + dask-ml = [ + dask-ml + ]; + #harmony = [ + # harmonypy + #]; + leiden = [ + igraph + leidenalg + ]; + #louvain = [ + # igraph + # louvain + #]; + #magic = [ + # magic-impute + #]; + paga = [ + igraph + ]; + #rapids = [ + # cudf + # cugraph + # cuml + #]; + #scanorama = [ + # scanorama + #]; + scrublet = [ + scikit-image + ]; + skmisc = [ + scikit-misc + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + pytest-mock + pytest-randomly + pytest-rerunfailures + pytest-xdist + tuna + zarr + ]; + + preCheck = '' + export NUMBA_CACHE_DIR=$(mktemp -d); + ''; + + disabledTestPaths = [ + # try to download data: + "tests/test_aggregated.py" + "tests/test_highly_variable_genes.py" + "tests/test_normalization.py" + "tests/test_pca.py" + "tests/test_plotting.py" + "tests/test_plotting_embedded/" + ]; + + disabledTests = [ + # try to download data: + "scanpy.get._aggregated.aggregate" + "scanpy.plotting._tools.scatterplots.spatial" + "test_clip" + "test_download_failure" + "test_mean_var" + "test_regress_out_int" + "test_score_with_reference" + + # fails to find the trivial test script for some reason: + "test_external" + ]; + + 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}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ bcdarwin ]; + mainProgram = "scanpy"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2d406a3df7c9..2f81bb0a56e1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16157,6 +16157,8 @@ self: super: with self; { scancode-toolkit = callPackage ../development/python-modules/scancode-toolkit { }; + scanpy = callPackage ../development/python-modules/scanpy { }; + scapy = callPackage ../development/python-modules/scapy { inherit (pkgs) libpcap; # Avoid confusion with python package of the same name };