1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 hatch-vcs,
9 hatchling,
10
11 # dependencies
12 awkward,
13 cramjam,
14 numpy,
15 fsspec,
16 packaging,
17
18 # checks
19 awkward-pandas,
20 pandas,
21 pytestCheckHook,
22 pytest-timeout,
23 rangehttpserver,
24 scikit-hep-testdata,
25 xxhash,
26}:
27
28buildPythonPackage rec {
29 pname = "uproot";
30 version = "5.5.1";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "scikit-hep";
35 repo = "uproot5";
36 rev = "refs/tags/v${version}";
37 hash = "sha256-a5gCsv8iBUUASHCJIpxFbgBXTSm/KJOTt6fvSvP/Lio=";
38 };
39
40 build-system = [
41 hatch-vcs
42 hatchling
43 ];
44
45 dependencies = [
46 awkward
47 cramjam
48 numpy
49 fsspec
50 packaging
51 xxhash
52 ];
53
54 nativeCheckInputs = [
55 awkward-pandas
56 pandas
57 pytestCheckHook
58 pytest-timeout
59 rangehttpserver
60 scikit-hep-testdata
61 ];
62
63 preCheck = ''
64 export HOME="$(mktemp -d)"
65 '';
66
67 disabledTests =
68 [
69 # Tests that try to download files
70 "test_descend_into_path_classname_of"
71 "test_fallback"
72 "test_fsspec_cache_http"
73 "test_fsspec_cache_http_directory"
74 "test_fsspec_chunks"
75 "test_fsspec_globbing_http"
76 "test_http"
77 "test_http_fallback_workers"
78 "test_http_multipart"
79 "test_http_port"
80 "test_http_size"
81 "test_http_size_port"
82 "test_http_workers"
83 "test_issue176"
84 "test_issue176_again"
85 "test_issue_1054_filename_colons"
86 "test_no_multipart"
87 "test_open_fsspec_github"
88 "test_open_fsspec_http"
89 "test_pickle_roundtrip_http"
90
91 # Cyclic dependency with dask-awkward
92 "test_dask_duplicated_keys"
93 "test_decompression_executor_for_dask"
94 "test_decompression_threadpool_executor_for_dask"
95 ]
96 ++ lib.optionals stdenv.hostPlatform.isDarwin [
97 # Tries to connect to localhost:22
98 # PermissionError: [Errno 1] Operation not permitted
99 "test_open_fsspec_ssh"
100 ];
101
102 disabledTestPaths = [
103 # Tests that try to download files
104 "tests/test_0066_fix_http_fallback_freeze.py"
105 "tests/test_0220_contiguous_byte_ranges_in_http.py"
106 ];
107
108 __darwinAllowLocalNetworking = true;
109
110 pythonImportsCheck = [ "uproot" ];
111
112 meta = {
113 description = "ROOT I/O in pure Python and Numpy";
114 homepage = "https://github.com/scikit-hep/uproot5";
115 changelog = "https://github.com/scikit-hep/uproot5/releases/tag/v${version}";
116 license = lib.licenses.bsd3;
117 maintainers = with lib.maintainers; [ veprbl ];
118 };
119}