1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 freezegun,
6 mock,
7 pytestCheckHook,
8 pythonOlder,
9 pytz,
10 setuptools,
11 six,
12}:
13
14buildPythonPackage rec {
15 pname = "duo-client";
16 version = "5.5.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "duosecurity";
23 repo = "duo_client_python";
24 tag = version;
25 hash = "sha256-5ZPs2099G9oBbDpComNDP3c4B0NjWirBMZY4orO9YfA=";
26 };
27
28 postPatch = ''
29 substituteInPlace requirements-dev.txt \
30 --replace-fail "dlint" "" \
31 --replace-fail "flake8" ""
32 '';
33
34 build-system = [ setuptools ];
35
36 dependencies = [ six ];
37
38 nativeCheckInputs = [
39 freezegun
40 mock
41 pytestCheckHook
42 pytz
43 ];
44
45 pythonImportsCheck = [ "duo_client" ];
46
47 disabledTests = [
48 # Tests require network access
49 "test_server_hostname"
50 "test_server_hostname_with_port"
51 "test_get_billing_edition"
52 "test_get_telephony_credits"
53 "test_set_business_billing_edition"
54 "test_set_enterprise_billing_edition"
55 "test_set_telephony_credits"
56 ];
57
58 meta = with lib; {
59 description = "Python library for interacting with the Duo Auth, Admin, and Accounts APIs";
60 homepage = "https://github.com/duosecurity/duo_client_python";
61 changelog = "https://github.com/duosecurity/duo_client_python/releases/tag/${src.tag}";
62 license = licenses.bsd3;
63 maintainers = [ ];
64 };
65}