Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ buildPythonPackage 2, fetchPypi 3, fetchurl 4, lib 5, nixosTests 6, python 7, pythonOlder 8 9# pythonPackages 10, hatchling 11, dnspython 12, expiringdict 13, publicsuffix2 14, xmltodict 15, geoip2 16, urllib3 17, requests 18, imapclient 19, dateparser 20, mailsuite 21, elasticsearch 22, elasticsearch-dsl 23, kafka-python 24, tqdm 25, lxml 26, boto3 27, msgraph-core 28, azure-identity 29, google-api-core 30, google-api-python-client 31, google-auth 32, google-auth-httplib2 33, google-auth-oauthlib 34}: 35 36let 37 dashboard = fetchurl { 38 url = "https://raw.githubusercontent.com/domainaware/parsedmarc/77331b55c54cb3269205295bd57d0ab680638964/grafana/Grafana-DMARC_Reports.json"; 39 sha256 = "0wbihyqbb4ndjg79qs8088zgrcg88km8khjhv2474y7nzjzkf43i"; 40 }; 41in 42buildPythonPackage rec { 43 pname = "parsedmarc"; 44 version = "8.4.2"; 45 46 disabled = pythonOlder "3.7"; 47 48 format = "pyproject"; 49 50 src = fetchPypi { 51 inherit pname version; 52 hash = "sha256-6dP9zQI0jYiE+lUhmFBNp8Sv9povm9Pa4R4TuzAmEQk="; 53 }; 54 55 postPatch = '' 56 substituteInPlace pyproject.toml \ 57 --replace "elasticsearch<7.14.0" "elasticsearch" 58 ''; 59 60 nativeBuildInputs = [ 61 hatchling 62 ]; 63 64 propagatedBuildInputs = [ 65 dnspython 66 expiringdict 67 publicsuffix2 68 xmltodict 69 geoip2 70 urllib3 71 requests 72 imapclient 73 dateparser 74 mailsuite 75 elasticsearch 76 elasticsearch-dsl 77 kafka-python 78 tqdm 79 lxml 80 boto3 81 msgraph-core 82 azure-identity 83 google-api-core 84 google-api-python-client 85 google-auth 86 google-auth-httplib2 87 google-auth-oauthlib 88 ]; 89 90 # no tests on PyPI, no tags on GitHub 91 doCheck = false; 92 93 pythonImportsCheck = [ "parsedmarc" ]; 94 95 passthru = { 96 inherit dashboard; 97 tests = nixosTests.parsedmarc; 98 }; 99 100 meta = { 101 changelog = "https://github.com/domainaware/parsedmarc/blob/master/CHANGELOG.md#${lib.replaceStrings [ "." ] [ "" ] version}"; 102 description = "Python module and CLI utility for parsing DMARC reports"; 103 homepage = "https://domainaware.github.io/parsedmarc/"; 104 maintainers = with lib.maintainers; [ talyz ]; 105 license = lib.licenses.asl20; 106 }; 107}