1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # build-system
8 hatch-fancy-pypi-readme,
9 hatchling,
10
11 # dependencies
12 awkward-cpp,
13 fsspec,
14 numpy,
15 packaging,
16 typing-extensions,
17 importlib-metadata,
18
19 # checks
20 numba,
21 setuptools,
22 numexpr,
23 pandas,
24 pyarrow,
25 pytest-xdist,
26 pytestCheckHook,
27 jax,
28 jaxlib,
29
30 stdenv,
31}:
32
33buildPythonPackage rec {
34 pname = "awkward";
35 version = "2.7.2";
36 pyproject = true;
37
38 src = fetchFromGitHub {
39 owner = "scikit-hep";
40 repo = "awkward";
41 tag = "v${version}";
42 hash = "sha256-nOKMwAQ5t8tc64bEKz0j8JxxoVQQu39Iu8Zr9cqSx7A=";
43 };
44
45 build-system = [
46 hatch-fancy-pypi-readme
47 hatchling
48 ];
49
50 dependencies =
51 [
52 awkward-cpp
53 fsspec
54 numpy
55 packaging
56 ]
57 ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]
58 ++ lib.optionals (pythonOlder "3.12") [ importlib-metadata ];
59
60 dontUseCmakeConfigure = true;
61
62 pythonImportsCheck = [ "awkward" ];
63
64 nativeCheckInputs =
65 [
66 fsspec
67 numba
68 setuptools
69 numexpr
70 pandas
71 pyarrow
72 pytest-xdist
73 pytestCheckHook
74 ]
75 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
76 # no support for darwin
77 jax
78 jaxlib
79 ];
80
81 # The following tests have been disabled because they need to be run on a GPU platform.
82 disabledTestPaths = [
83 "tests-cuda"
84 # Disable tests dependending on jax on darwin
85 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_2603_custom_behaviors_with_jax.py" ];
86
87 disabledTests = [
88 # AssertionError: Regex pattern did not match.
89 "test_serialise_with_nonserialisable_attrs"
90 "test_serialise_with_nonserialisable_attrs"
91 ];
92
93 meta = {
94 description = "Manipulate JSON-like data with NumPy-like idioms";
95 homepage = "https://github.com/scikit-hep/awkward";
96 changelog = "https://github.com/scikit-hep/awkward/releases/tag/v${version}";
97 license = lib.licenses.bsd3;
98 maintainers = with lib.maintainers; [ veprbl ];
99 };
100}