From 1270c985f1aab299a3d5e3bf0dfd9f8019f502d6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Sep 2023 19:16:27 +0200 Subject: [PATCH] python311Packages.checkdmarc: init at 4.8.0 --- .../python-modules/checkdmarc/default.nix | 76 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 78 insertions(+) create mode 100644 pkgs/development/python-modules/checkdmarc/default.nix diff --git a/pkgs/development/python-modules/checkdmarc/default.nix b/pkgs/development/python-modules/checkdmarc/default.nix new file mode 100644 index 000000000000..e7cedec9791b --- /dev/null +++ b/pkgs/development/python-modules/checkdmarc/default.nix @@ -0,0 +1,76 @@ +{ lib +, buildPythonPackage +, cryptography +, dnspython +, expiringdict +, fetchFromGitHub +, hatchling +, publicsuffixlist +, pyleri +, iana-etc +, pytestCheckHook +, pythonOlder +, requests +, timeout-decorator +}: + +buildPythonPackage rec { + pname = "checkdmarc"; + version = "4.8.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "domainaware"; + repo = "checkdmarc"; + # https://github.com/domainaware/checkdmarc/issues/102 + rev = "d0364ceef3cfd41052273913369e3831cb6fe4fd"; + hash = "sha256-OSljewDeyJtoxkCQjPU9wIsNhhxumHmeu9GHvRD4DRY="; + }; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + cryptography + dnspython + expiringdict + publicsuffixlist + pyleri + requests + timeout-decorator + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "checkdmarc" + ]; + + pytestFlagsArray = [ + "tests.py" + ]; + + disabledTests = [ + # Tests require network access + "testDMARCPctLessThan100Warning" + "testSPFMissingARecord" + "testSPFMissingMXRecord" + "testSplitSPFRecord" + "testTooManySPFDNSLookups" + "testTooManySPFVoidDNSLookups" + ]; + + meta = with lib; { + description = "A parser for SPF and DMARC DNS records"; + homepage = "https://github.com/domainaware/checkdmarc"; + changelog = "https://github.com/domainaware/checkdmarc/blob/${version}/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 75e0e3cd23c2..830ad211167d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1889,6 +1889,8 @@ self: super: with self; { check-manifest = callPackage ../development/python-modules/check-manifest { }; + checkdmarc = callPackage ../development/python-modules/checkdmarc { }; + cheetah3 = callPackage ../development/python-modules/cheetah3 { }; cheroot = callPackage ../development/python-modules/cheroot { };