summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ome-zarr/default.nix
blob: 78f854f744b7c29b00752a2cc7898ed106338aba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-scm,

  # dependencies
  aiohttp,
  dask,
  fsspec,
  numpy,
  requests,
  scikit-image,
  toolz,
  zarr,

  # tests
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "ome-zarr";
  version = "0.12.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ome";
    repo = "ome-zarr-py";
    tag = "v${version}";
    hash = "sha256-lwv6PHm41HFylt7b0d5LHCrCIXNWFNGg59VQvPXYtVc=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    aiohttp
    dask
    fsspec
    numpy
    requests
    scikit-image
    toolz
    zarr
  ]
  ++ fsspec.optional-dependencies.s3;

  nativeCheckInputs = [
    pytestCheckHook
  ];

  disabledTests = [
    # attempts to access network
    "test_s3_info"

    # AssertionError: assert {'blocksize':... 'blosc', ...} == {'blocksize':... 'blosc', ...}
    # comp {'id': 'blosc', 'cname': 'lz4', 'clevel': 5, 'shuffle': 1, 'blocksize': 0}
    "test_default_compression"
    "test_write_image_compressed"
  ];

  disabledTestPaths = [
    # Fail with RecursionError
    # https://github.com/ome/ome-zarr-py/issues/352
    "tests/test_cli.py::TestCli::test_astronaut_download"
    "tests/test_cli.py::TestCli::test_astronaut_info"
    "tests/test_cli.py::TestCli::test_coins_info"
    "tests/test_emitter.py::test_close"
    "tests/test_emitter.py::test_create_wrong_encoding"
    "tests/test_node.py::TestNode::test_image"
    "tests/test_node.py::TestNode::test_label"
    "tests/test_node.py::TestNode::test_labels"
    "tests/test_ome_zarr.py::TestOmeZarr::test_download"
    "tests/test_ome_zarr.py::TestOmeZarr::test_info"
    "tests/test_reader.py::TestReader::test_image"
    "tests/test_reader.py::TestReader::test_label"
    "tests/test_reader.py::TestReader::test_labels"
    "tests/test_starting_points.py::TestStartingPoints::test_label"
    "tests/test_starting_points.py::TestStartingPoints::test_labels"
    "tests/test_starting_points.py::TestStartingPoints::test_top_level"

    # tries to access network:
    "ome_zarr/io.py"
  ];

  pythonImportsCheck = [
    "ome_zarr"
    "ome_zarr.cli"
    "ome_zarr.csv"
    "ome_zarr.data"
    "ome_zarr.format"
    "ome_zarr.io"
    "ome_zarr.reader"
    "ome_zarr.writer"
    "ome_zarr.scale"
    "ome_zarr.utils"
  ];

  meta = {
    description = "Implementation of next-generation file format (NGFF) specifications for storing bioimaging data in the cloud";
    homepage = "https://pypi.org/project/ome-zarr";
    changelog = "https://github.com/ome/ome-zarr-py/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.bsd2;
    maintainers = [ lib.maintainers.bcdarwin ];
    mainProgram = "ome_zarr";
  };
}