1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # nativeBuildInputs
8 cmake,
9
10 # build-system
11 pybind11,
12 nanobind,
13 ninja,
14 scikit-build-core,
15 setuptools-scm,
16
17 # buildInputs
18 boost,
19
20 # dependencies
21 numpy,
22
23 # tests
24 pytestCheckHook,
25 pytest-benchmark,
26}:
27
28buildPythonPackage rec {
29 pname = "boost-histogram";
30 version = "1.5.1";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "scikit-hep";
35 repo = "boost-histogram";
36 tag = "v${version}";
37 hash = "sha256-7E4y3P3RzVmIHb5mEoEYWZSwWnmL3LbGqYjGbnszM98=";
38 };
39
40 nativeBuildInputs = [ cmake ];
41
42 dontUseCmakeConfigure = true;
43
44 build-system = [
45 pybind11
46 nanobind
47 ninja
48 scikit-build-core
49 setuptools-scm
50 ];
51
52 buildInputs = [ boost ];
53
54 dependencies = [ numpy ];
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 pytest-benchmark
59 ];
60
61 pytestFlags = [ "--benchmark-disable" ];
62
63 disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
64 # Segfaults: boost_histogram/_internal/hist.py", line 799 in sum
65 # Fatal Python error: Segmentation fault
66 "test_numpy_conversion_4"
67 ];
68
69 meta = {
70 description = "Python bindings for the C++14 Boost::Histogram library";
71 homepage = "https://github.com/scikit-hep/boost-histogram";
72 changelog = "https://github.com/scikit-hep/boost-histogram/releases/tag/v${version}";
73 license = lib.licenses.bsd3;
74 maintainers = with lib.maintainers; [ veprbl ];
75 };
76}