1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 setuptools,
7 cython,
8 click,
9 numpy,
10 scipy,
11 pandas,
12 h5py,
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "biom-format";
18 version = "2.1.15";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "biocore";
23 repo = "biom-format";
24 rev = "refs/tags/${version}";
25 hash = "sha256-WRBc+C/UWme7wYogy4gH4KTIdIqU3KmBm2jWzGNxGQg=";
26 };
27
28 patches = [
29 # fixes a test, can be removed in next version after 2.1.15
30 (fetchpatch {
31 name = "fix-dataframe-comparison.patch";
32 url = "https://github.com/biocore/biom-format/commit/5d1c921ca2cde5d7332508503ce990a7209d1fdc.patch";
33 hash = "sha256-nyHi469ivjJSQ01yIk/6ZMXFdoo9wVuazJHnFdy2nBg=";
34 })
35 ];
36
37 build-system = [
38 setuptools
39 cython
40 numpy
41 ];
42
43 dependencies = [
44 click
45 numpy
46 scipy
47 pandas
48 h5py
49 ];
50
51 # make pytest resolve the package from $out
52 # some tests don't work if we change the level of directory nesting
53 preCheck = ''
54 mkdir biom_tests
55 mv biom/tests biom_tests/tests
56 rm -r biom
57 '';
58
59 nativeCheckInputs = [ pytestCheckHook ];
60
61 pytestFlagsArray = [ "biom_tests/tests" ];
62
63 pythonImportsCheck = [ "biom" ];
64
65 meta = {
66 homepage = "http://biom-format.org/";
67 description = "Biological Observation Matrix (BIOM) format";
68 license = lib.licenses.bsd3;
69 maintainers = with lib.maintainers; [ tomasajt ];
70 };
71}