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