1{ lib
2, backports-zoneinfo
3, buildPythonPackage
4, cached-property
5, defusedxml
6, dnspython
7, fetchFromGitHub
8, fetchpatch
9, flake8
10, isodate
11, lxml
12, oauthlib
13, psutil
14, pygments
15, python-dateutil
16, pythonOlder
17, pytz
18, pyyaml
19, requests
20, requests_ntlm
21, requests-oauthlib
22, requests-kerberos
23, requests-mock
24, tzdata
25, tzlocal
26}:
27
28buildPythonPackage rec {
29 pname = "exchangelib";
30 version = "5.1.0";
31 format = "setuptools";
32
33 disabled = pythonOlder "3.7";
34
35 src = fetchFromGitHub {
36 owner = "ecederstrand";
37 repo = pname;
38 rev = "refs/tags/v${version}";
39 hash = "sha256-WKQgfmEbil55WO3tWVq4n9wiJNw0Op/jbI7xt5vtKpA=";
40 };
41
42 patches = [
43 (fetchpatch {
44 name = "tests-timezones-2.patch";
45 url = "https://github.com/ecederstrand/exchangelib/commit/419eafcd9261bfd0617823ee437204d5556a8271.diff";
46 excludes = [ "tests/test_ewsdatetime.py" ];
47 hash = "sha256-dSp6NkNT5dHOg8XgDi8sR3t3hq46sNtPjUXva2YfFSU=";
48 })
49 ];
50
51 propagatedBuildInputs = [
52 cached-property
53 defusedxml
54 dnspython
55 isodate
56 lxml
57 oauthlib
58 pygments
59 requests
60 requests_ntlm
61 requests-oauthlib
62 requests-kerberos
63 tzdata
64 tzlocal
65 ] ++ lib.optionals (pythonOlder "3.9") [
66 backports-zoneinfo
67 ];
68
69 nativeCheckInputs = [
70 flake8
71 psutil
72 python-dateutil
73 pytz
74 pyyaml
75 requests-mock
76 ];
77
78 pythonImportsCheck = [
79 "exchangelib"
80 ];
81
82 meta = with lib; {
83 description = "Client for Microsoft Exchange Web Services (EWS)";
84 homepage = "https://github.com/ecederstrand/exchangelib";
85 changelog = "https://github.com/ecederstrand/exchangelib/blob/v${version}/CHANGELOG.md";
86 license = licenses.bsd2;
87 maintainers = with maintainers; [ catern ];
88 };
89}