2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
freezegun,
|
|
|
|
mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pytz,
|
|
|
|
setuptools,
|
|
|
|
six,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "duo-client";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "5.3.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "duosecurity";
|
|
|
|
repo = "duo_client_python";
|
2023-02-22 10:55:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-7cifxNSBHbX7QZ52Sy1hm5xzZYcLZOkloT6q9P7TO6A=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements-dev.txt \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "dlint" "" \
|
|
|
|
--replace-fail "flake8" ""
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [ six ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-02 22:02:43 +00:00
|
|
|
freezegun
|
2022-06-16 17:23:12 +00:00
|
|
|
mock
|
2023-11-16 04:20:00 +00:00
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
pytz
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "duo_client" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_server_hostname"
|
|
|
|
"test_server_hostname_with_port"
|
2024-01-13 08:15:51 +00:00
|
|
|
"test_get_billing_edition"
|
|
|
|
"test_get_telephony_credits"
|
|
|
|
"test_set_business_billing_edition"
|
|
|
|
"test_set_enterprise_billing_edition"
|
|
|
|
"test_set_telephony_credits"
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for interacting with the Duo Auth, Admin, and Accounts APIs";
|
|
|
|
homepage = "https://github.com/duosecurity/duo_client_python";
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://github.com/duosecurity/duo_client_python/releases/tag/${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.bsd3;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|