python313Packages.scanpy: init at 1.11.4 (#433795)

This commit is contained in:
Samuel Ainsworth
2025-08-22 16:49:56 -04:00
committed by GitHub
4 changed files with 256 additions and 33 deletions
@@ -1,4 +1,5 @@
{
anndata,
array-api-compat,
awkward,
boltons,
@@ -17,17 +18,15 @@
numba,
numpy,
openpyxl,
packaging,
pandas,
pyarrow,
pytest-mock,
pytest-xdist,
pytestCheckHook,
pythonOlder,
scanpy,
scikit-learn,
scipy,
stdenv,
typing-extensions,
zarr,
}:
@@ -56,6 +55,7 @@ buildPythonPackage rec {
numpy
pandas
scipy
zarr
];
nativeCheckInputs = [
@@ -72,7 +72,7 @@ buildPythonPackage rec {
pytest-xdist
pytestCheckHook
scikit-learn
zarr
scanpy
];
# Optionally disable pytest-xdist to make it easier to debug the test suite.
@@ -80,43 +80,22 @@ buildPythonPackage rec {
# fail when running without pytest-xdist ("worker_id not found").
# pytestFlags = [ "-oaddopts=" ];
disabledTestPaths = [
# Tests that require scanpy, creating a circular dependency chain
"src/anndata/_core/anndata.py"
"src/anndata/_core/merge.py"
"src/anndata/_core/sparse_dataset.py"
"src/anndata/_io/specs/registry.py"
"src/anndata/_io/utils.py"
"src/anndata/_warnings.py"
"src/anndata/experimental/merge.py"
"src/anndata/experimental/multi_files/_anncollection.py"
"src/anndata/utils.py"
];
preCheck = ''
export NUMBA_CACHE_DIR=$(mktemp -d);
'';
doCheck = false; # use passthru.tests instead to prevent circularity with `scanpy`
passthru.tests = anndata.overridePythonAttrs { doCheck = true; };
disabledTests = [
# requires data from a previous test execution:
"test_no_diff"
# doctests that require scanpy, creating a circular dependency chain. These
# do not work in disabledTestPaths for some reason.
"anndata._core.anndata.AnnData.concatenate"
"anndata._core.anndata.AnnData.obs_names_make_unique"
"anndata._core.anndata.AnnData.var_names_make_unique"
"anndata._core.extensions.register_anndata_namespac"
"anndata._core.merge.concat"
"anndata._core.merge.gen_reindexer"
"anndata._core.sparse_dataset.sparse_dataset"
"anndata._io.specs.registry.read_elem_as_dask"
# try to download data:
"anndata._io.specs.registry.read_elem_lazy"
"anndata._io.utils.report_read_key_on_error"
"anndata._io.utils.report_write_key_on_error"
"anndata._warnings.ImplicitModificationWarning"
"anndata.experimental.backed._io.read_lazy"
"anndata.experimental.merge.concat_on_disk"
"anndata.experimental.multi_files._anncollection.AnnCollection"
"anndata.utils.make_index_unique"
"ci.scripts.min-deps.min_dep"
"concatenation.rst"
# Tests that require cupy and GPU access. Introducing cupy as a dependency
# would make this package unfree and GPU access is not possible within the
@@ -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";
};
}
@@ -0,0 +1,58 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatch-docstring-description,
hatch-vcs,
hatchling,
coverage,
ipykernel,
jupyter-client,
pytestCheckHook,
pytest-asyncio,
pytest-subprocess,
testing-common-database,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "session-info2";
version = "0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "scverse";
repo = "session-info2";
tag = "v${version}";
hash = "sha256-DsI2mFM7xZgSm24yVzF6B+2aruKsjkTKZAmJPg7mWgg=";
};
build-system = [
hatch-docstring-description
hatch-vcs
hatchling
];
nativeCheckInputs = [
coverage
ipykernel
jupyter-client
pytestCheckHook
pytest-asyncio
pytest-subprocess
testing-common-database
writableTmpDirAsHomeHook
];
pythonImportsCheck = [
"session_info2"
];
meta = {
description = "Report Python session information";
homepage = "https://session-info2.readthedocs.io";
changelog = "https://github.com/scverse/session-info2/releases/tag/${src.tag}";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}
+4
View File
@@ -16185,6 +16185,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
};
@@ -16435,6 +16437,8 @@ self: super: with self; {
service-identity = callPackage ../development/python-modules/service-identity { };
session-info2 = callPackage ../development/python-modules/session-info2 { };
setproctitle = callPackage ../development/python-modules/setproctitle { };
setupmeta = callPackage ../development/python-modules/setupmeta { };