1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8 hatch-vcs,
9
10 # dependencies
11 aiohttp,
12 awkward,
13 cachetools,
14 cloudpickle,
15 correctionlib,
16 dask,
17 dask-awkward,
18 dask-histogram,
19 hist,
20 lz4,
21 matplotlib,
22 mplhep,
23 numba,
24 numpy,
25 packaging,
26 pandas,
27 pyarrow,
28 requests,
29 scipy,
30 toml,
31 tqdm,
32 uproot,
33 vector,
34
35 # tests
36 distributed,
37 pyinstrument,
38 pytest-xdist,
39 pytestCheckHook,
40}:
41
42buildPythonPackage rec {
43 pname = "coffea";
44 version = "2025.7.3";
45 pyproject = true;
46
47 src = fetchFromGitHub {
48 owner = "CoffeaTeam";
49 repo = "coffea";
50 tag = "v${version}";
51 hash = "sha256-lCrmWcVzu8Ls0a+r2D1DMZ/Ysq3H9bPj13XOmAS1M5I=";
52 };
53
54 build-system = [
55 hatchling
56 hatch-vcs
57 ];
58
59 pythonRelaxDeps = [
60 "dask"
61 ];
62
63 dependencies = [
64 aiohttp
65 awkward
66 cachetools
67 cloudpickle
68 correctionlib
69 dask
70 dask-awkward
71 dask-histogram
72 hist
73 lz4
74 matplotlib
75 mplhep
76 numba
77 numpy
78 packaging
79 pandas
80 pyarrow
81 requests
82 scipy
83 toml
84 tqdm
85 uproot
86 vector
87 ]
88 ++ dask.optional-dependencies.array;
89
90 nativeCheckInputs = [
91 distributed
92 pyinstrument
93 pytest-xdist
94 pytestCheckHook
95 ];
96
97 pythonImportsCheck = [ "coffea" ];
98
99 disabledTests = [
100 # Requires internet access
101 # https://github.com/CoffeaTeam/coffea/issues/1094
102 "test_lumimask"
103
104 # Flaky: FileNotFoundError: [Errno 2] No such file or directory
105 # https://github.com/scikit-hep/coffea/issues/1246
106 "test_packed_selection_cutflow_dak" # cutflow.npz
107 "test_packed_selection_nminusone_dak" # nminusone.npz
108 ];
109
110 __darwinAllowLocalNetworking = true;
111
112 meta = {
113 description = "Basic tools and wrappers for enabling not-too-alien syntax when running columnar Collider HEP analysis";
114 homepage = "https://github.com/CoffeaTeam/coffea";
115 changelog = "https://github.com/CoffeaTeam/coffea/releases/tag/${src.tag}";
116 license = with lib.licenses; [ bsd3 ];
117 maintainers = with lib.maintainers; [ veprbl ];
118 };
119}