about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix118
1 files changed, 118 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix b/nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix
new file mode 100644
index 000000000000..e8763988fdb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/dns-lexicon/default.nix
@@ -0,0 +1,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.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "Analogj";
+    repo = "lexicon";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-GUYsTZPvsqGemViSqgEvYhyjTEut42akMq2ZK2P1fX0=";
+  };
+
+  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 ];
+  };
+}