1{
2 lib,
3 buildPythonPackage,
4 cryptography,
5 dnspython,
6 expiringdict,
7 fetchFromGitHub,
8 hatchling,
9 importlib-resources,
10 pem,
11 publicsuffixlist,
12 pyleri,
13 pyopenssl,
14 pytestCheckHook,
15 pythonOlder,
16 requests,
17 timeout-decorator,
18 xmltodict,
19}:
20
21buildPythonPackage rec {
22 pname = "checkdmarc";
23 version = "5.10.12";
24 format = "pyproject";
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "domainaware";
30 repo = "checkdmarc";
31 tag = version;
32 hash = "sha256-XbBdBef3+kt26XP5GDH5rgHYGh8xIjHUUVOcdeVICLs=";
33 };
34
35 pythonRelaxDeps = [ "xmltodict" ];
36
37 build-system = [ hatchling ];
38
39 dependencies = [
40 cryptography
41 dnspython
42 expiringdict
43 importlib-resources
44 pem
45 publicsuffixlist
46 pyleri
47 pyopenssl
48 requests
49 timeout-decorator
50 xmltodict
51 ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 pythonImportsCheck = [ "checkdmarc" ];
56
57 enabledTestPaths = [ "tests.py" ];
58
59 disabledTests = [
60 # Tests require network access
61 "testBIMI"
62 "testDMARCPctLessThan100Warning"
63 "testSPFMissingARecord"
64 "testSPFMissingMXRecord"
65 "testSplitSPFRecord"
66 "testTooManySPFDNSLookups"
67 "testTooManySPFVoidDNSLookups"
68 ];
69
70 meta = with lib; {
71 description = "Parser for SPF and DMARC DNS records";
72 mainProgram = "checkdmarc";
73 homepage = "https://github.com/domainaware/checkdmarc";
74 changelog = "https://github.com/domainaware/checkdmarc/blob/${src.tag}/CHANGELOG.md";
75 license = licenses.asl20;
76 maintainers = with maintainers; [ fab ];
77 };
78}