1{
2 lib,
3 beautifulsoup4,
4 boto3,
5 buildPythonPackage,
6 cryptography,
7 dnspython,
8 fetchFromGitHub,
9 importlib-metadata,
10 localzone,
11 oci,
12 poetry-core,
13 pyotp,
14 pytest-vcr,
15 pytestCheckHook,
16 pythonOlder,
17 pyyaml,
18 requests,
19 softlayer,
20 tldextract,
21 zeep,
22}:
23
24buildPythonPackage rec {
25 pname = "dns_lexicon";
26 version = "3.16.1";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchFromGitHub {
32 owner = "Analogj";
33 repo = "lexicon";
34 tag = "v${version}";
35 hash = "sha256-79/zz0TOCpx26TEo6gi9JDBQeVW2azWnxAjWr/FGRLA=";
36 };
37
38 nativeBuildInputs = [ poetry-core ];
39
40 propagatedBuildInputs = [
41 beautifulsoup4
42 cryptography
43 pyotp
44 pyyaml
45 requests
46 tldextract
47 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
48
49 optional-dependencies = {
50 route53 = [ boto3 ];
51 localzone = [ localzone ];
52 softlayer = [ softlayer ];
53 ddns = [ dnspython ];
54 duckdns = [ dnspython ];
55 oci = [ oci ];
56 full = [
57 boto3
58 dnspython
59 localzone
60 oci
61 softlayer
62 zeep
63 ];
64 };
65
66 nativeCheckInputs = [
67 pytestCheckHook
68 pytest-vcr
69 ] ++ optional-dependencies.full;
70
71 pytestFlagsArray = [ "tests/" ];
72
73 disabledTestPaths = [
74 # Needs network access
75 "tests/providers/test_auto.py"
76 # Needs network access (and an API token)
77 "tests/providers/test_namecheap.py"
78 ];
79
80 disabledTests = [
81 # Tests want to download Public Suffix List
82 "test_client_legacy_init"
83 "test_client_basic_init"
84 "test_client_init"
85 "test_client_parse_env"
86 "test_missing"
87 "action_is_correctly"
88 ];
89
90 pythonImportsCheck = [ "lexicon" ];
91
92 meta = with lib; {
93 description = "Manipulate DNS records on various DNS providers in a standardized way";
94 mainProgram = "lexicon";
95 homepage = "https://github.com/AnalogJ/lexicon";
96 changelog = "https://github.com/AnalogJ/lexicon/blob/v${version}/CHANGELOG.md";
97 license = with licenses; [ mit ];
98 maintainers = with maintainers; [ aviallon ];
99 };
100}