summary refs log tree commit diff
path: root/pkgs/development/python-modules/dns-lexicon/default.nix
blob: 6cc982c5df5325ec33458c1ad851498e51c38201 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{ lib
, beautifulsoup4
, boto3
, buildPythonPackage
, cryptography
, dnspython
, fetchFromGitHub
, importlib-metadata
, localzone
, oci
, poetry-core
, pyotp
, pytest-vcr
, pytestCheckHook
, pythonOlder
, pyyaml
, requests
, softlayer
, tldextract
, zeep
}:

buildPythonPackage rec {
  pname = "dns_lexicon";
  version = "3.16.1";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "Analogj";
    repo = "lexicon";
    rev = "refs/tags/v${version}";
    hash = "sha256-79/zz0TOCpx26TEo6gi9JDBQeVW2azWnxAjWr/FGRLA=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    beautifulsoup4
    cryptography
    pyotp
    pyyaml
    requests
    tldextract
  ] ++ lib.optionals (pythonOlder "3.10") [
    importlib-metadata
  ];

  passthru.optional-dependencies = {
    route53 = [
      boto3
    ];
    localzone = [
      localzone
    ];
    softlayer = [
      softlayer
    ];
    ddns = [
      dnspython
    ];
    duckdns = [
      dnspython
    ];
    oci = [
      oci
    ];
    full = [
      boto3
      dnspython
      localzone
      oci
      softlayer
      zeep
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
    pytest-vcr
  ] ++ passthru.optional-dependencies.full;

  pytestFlagsArray = [
    "tests/"
  ];

  disabledTestPaths = [
    # Needs network access
    "tests/providers/test_auto.py"
    # Needs network access (and an API token)
    "tests/providers/test_namecheap.py"
  ];

  disabledTests = [
    # Tests want to download Public Suffix List
    "test_client_legacy_init"
    "test_client_basic_init"
    "test_client_init"
    "test_client_parse_env"
    "test_missing"
    "action_is_correctly"
  ];

  pythonImportsCheck = [
    "lexicon"
  ];

  meta = with lib; {
    description = "Manipulate DNS records on various DNS providers in a standardized way";
    homepage = "https://github.com/AnalogJ/lexicon";
    changelog = "https://github.com/AnalogJ/lexicon/blob/v${version}/CHANGELOG.md";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ aviallon ];
  };
}