1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 # build inputs
8 tqdm,
9 portalocker,
10 boto3,
11 # check inputs
12 pytestCheckHook,
13 torch,
14}:
15let
16 pname = "iopath";
17 version = "0.1.9";
18in
19buildPythonPackage {
20 inherit pname version;
21 format = "setuptools";
22
23 disabled = pythonOlder "3.10";
24
25 src = fetchFromGitHub {
26 owner = "facebookresearch";
27 repo = "iopath";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-Qubf/mWKMgYz9IVoptMZrwy4lQKsNGgdqpJB1j/u5s8=";
30 };
31
32 propagatedBuildInputs = [
33 tqdm
34 portalocker
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 torch
40 ];
41
42 disabledTests = [
43 # requires network access
44 "test_download"
45 "test_bad_args"
46 ];
47
48 disabledTestPaths = [
49 # flakey
50 "tests/async_torch_test.py"
51 "tests/async_writes_test.py"
52 ];
53
54 pythonImportsCheck = [ "iopath" ];
55
56 passthru.optional-dependencies = {
57 aws = [ boto3 ];
58 };
59
60 meta = with lib; {
61 description = "A python library that provides common I/O interface across different storage backends.";
62 homepage = "https://github.com/facebookresearch/iopath";
63 changelog = "https://github.com/facebookresearch/iopath/releases/tag/v${version}";
64 license = licenses.mit;
65 maintainers = with maintainers; [ happysalada ];
66 };
67}