1{
2 lib,
3 buildPythonPackage,
4 cheroot,
5 colorama,
6 fetchFromGitHub,
7 fsspec,
8 hatch-vcs,
9 hatchling,
10 httpx,
11 pytest-xdist,
12 pytestCheckHook,
13 pytest-cov-stub,
14 python-dateutil,
15 pythonOlder,
16 wsgidav,
17}:
18
19buildPythonPackage rec {
20 pname = "webdav4";
21 version = "0.10.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.9";
25
26 src = fetchFromGitHub {
27 owner = "skshetry";
28 repo = "webdav4";
29 tag = "v${version}";
30 hash = "sha256-LgWYgERRuUODFzUnC08kDJTVRx9vanJ+OU8sREEMVwM=";
31 };
32
33 build-system = [
34 hatch-vcs
35 hatchling
36 ];
37
38 dependencies = [
39 httpx
40 python-dateutil
41 ];
42
43 nativeCheckInputs = [
44 cheroot
45 colorama
46 pytest-xdist
47 pytestCheckHook
48 pytest-cov-stub
49 wsgidav
50 ]
51 ++ optional-dependencies.fsspec;
52
53 optional-dependencies = {
54 fsspec = [ fsspec ];
55 http2 = [ httpx.optional-dependencies.http2 ];
56 all = [
57 fsspec
58 httpx.optional-dependencies.http2
59 ];
60 };
61
62 pythonImportsCheck = [ "webdav4" ];
63
64 disabledTests = [
65 # ValueError: Invalid dir_browser htdocs_path
66 "test_retry_reconnect_on_failure"
67 "test_open"
68 "test_open_binary"
69 "test_close_connection_if_nothing_is_read"
70 # Assertion error due to comparing output
71 "test_cp_cli"
72 "test_mv_cli"
73 "test_sync_remote_to_local"
74 ];
75
76 disabledTestPaths = [
77 # Tests requires network access
78 "tests/test_client.py"
79 "tests/test_fsspec.py"
80 "tests/test_cli.py"
81 ];
82
83 meta = with lib; {
84 description = "Library for interacting with WebDAV";
85 mainProgram = "dav";
86 homepage = "https://skshetry.github.io/webdav4/";
87 changelog = "https://github.com/skshetry/webdav4/releases/tag/v${version}";
88 license = with licenses; [ mit ];
89 maintainers = with maintainers; [ fab ];
90 };
91}