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