python3Packages.scanpy: 1.11.5 -> 1.12.0 (#483219)

This commit is contained in:
kirillrdy
2026-01-24 09:41:30 +00:00
committed by GitHub
2 changed files with 146 additions and 21 deletions
@@ -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
];
};
}
})
@@ -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";
};
}
})