1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cmake,
8 cython,
9 ninja,
10 oldest-supported-numpy,
11 pkg-config,
12 scikit-build,
13 setuptools,
14 wheel,
15
16 # c library
17 c-blosc2,
18
19 # propagates
20 msgpack,
21 ndindex,
22 numpy,
23 py-cpuinfo,
24 rich,
25
26 # tests
27 psutil,
28 pytestCheckHook,
29 torch,
30}:
31
32buildPythonPackage rec {
33 pname = "blosc2";
34 version = "2.5.1";
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "Blosc";
39 repo = "python-blosc2";
40 rev = "refs/tags/v${version}";
41 hash = "sha256-yBgnNJU1q+FktIkpQn74LuRP19Ta/fNC60Z8TxzlWPk=";
42 };
43
44 postPatch = ''
45 substituteInPlace requirements-runtime.txt \
46 --replace "pytest" ""
47 '';
48
49 nativeBuildInputs = [
50 cmake
51 cython
52 ninja
53 oldest-supported-numpy
54 pkg-config
55 scikit-build
56 setuptools
57 wheel
58 ];
59
60 buildInputs = [ c-blosc2 ];
61
62 dontUseCmakeConfigure = true;
63 env.CMAKE_ARGS = "-DUSE_SYSTEM_BLOSC2:BOOL=YES";
64
65 propagatedBuildInputs = [
66 msgpack
67 ndindex
68 numpy
69 py-cpuinfo
70 rich
71 ];
72
73 nativeCheckInputs = [
74 psutil
75 pytestCheckHook
76 torch
77 ];
78
79 passthru.c-blosc2 = c-blosc2;
80
81 meta = with lib; {
82 description = "Python wrapper for the extremely fast Blosc2 compression library";
83 homepage = "https://github.com/Blosc/python-blosc2";
84 changelog = "https://github.com/Blosc/python-blosc2/releases/tag/v${version}";
85 license = licenses.bsd3;
86 maintainers = with maintainers; [ ris ];
87 };
88}