1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 hatchling,
9 hatch-vcs,
10
11 # optional-dependencies
12 adlfs,
13 pyarrow,
14 dask,
15 distributed,
16 requests,
17 dropbox,
18 aiohttp,
19 fusepy,
20 gcsfs,
21 libarchive-c,
22 ocifs,
23 panel,
24 paramiko,
25 pygit2,
26 s3fs,
27 smbprotocol,
28 tqdm,
29
30 # tests
31 numpy,
32 pytest-asyncio,
33 pytest-mock,
34 pytest-vcr,
35 pytestCheckHook,
36 writableTmpDirAsHomeHook,
37}:
38
39buildPythonPackage rec {
40 pname = "fsspec";
41 version = "2025.3.2";
42 pyproject = true;
43
44 src = fetchFromGitHub {
45 owner = "fsspec";
46 repo = "filesystem_spec";
47 tag = version;
48 hash = "sha256-FsgDILnnr+WApoTv/y1zVFSeBNysvkizdKtMeRegbfI=";
49 };
50
51 build-system = [
52 hatchling
53 hatch-vcs
54 ];
55
56 optional-dependencies = {
57 abfs = [ adlfs ];
58 adl = [ adlfs ];
59 arrow = [ pyarrow ];
60 dask = [
61 dask
62 distributed
63 ];
64 dropbox = [
65 dropbox
66 # dropboxdrivefs
67 requests
68 ];
69 entrypoints = [ ];
70 full = [
71 adlfs
72 aiohttp
73 dask
74 distributed
75 dropbox
76 # dropboxdrivefs
77 fusepy
78 gcsfs
79 libarchive-c
80 ocifs
81 panel
82 paramiko
83 pyarrow
84 pygit2
85 requests
86 s3fs
87 smbprotocol
88 tqdm
89 ];
90 fuse = [ fusepy ];
91 gcs = [ gcsfs ];
92 git = [ pygit2 ];
93 github = [ requests ];
94 gs = [ gcsfs ];
95 gui = [ panel ];
96 hdfs = [ pyarrow ];
97 http = [ aiohttp ];
98 libarchive = [ libarchive-c ];
99 oci = [ ocifs ];
100 s3 = [ s3fs ];
101 sftp = [ paramiko ];
102 smb = [ smbprotocol ];
103 ssh = [ paramiko ];
104 tqdm = [ tqdm ];
105 };
106
107 nativeCheckInputs = [
108 aiohttp
109 numpy
110 pytest-asyncio
111 pytest-mock
112 pytest-vcr
113 pytestCheckHook
114 requests
115 writableTmpDirAsHomeHook
116 ];
117
118 __darwinAllowLocalNetworking = true;
119
120 disabledTests = [
121 # network access to aws s3
122 "test_async_cat_file_ranges"
123 ]
124 ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
125 # works locally on APFS, fails on hydra with AssertionError comparing timestamps
126 # darwin hydra builder uses HFS+ and has only one second timestamp resolution
127 # this two tests however, assume nanosecond resolution
128 "test_modified"
129 "test_touch"
130 # tries to access /home, ignores $HOME
131 "test_directories"
132 ];
133
134 disabledTestPaths = [
135 # network access to github.com
136 "fsspec/implementations/tests/test_github.py"
137 ];
138
139 pythonImportsCheck = [ "fsspec" ];
140
141 meta = {
142 description = "Specification that Python filesystems should adhere to";
143 homepage = "https://github.com/fsspec/filesystem_spec";
144 changelog = "https://github.com/fsspec/filesystem_spec/raw/${version}/docs/source/changelog.rst";
145 license = lib.licenses.bsd3;
146 maintainers = with lib.maintainers; [ nickcao ];
147 };
148}