From 928146bc296cbda5615de5fb1d581299d10d1aa0 Mon Sep 17 00:00:00 2001 From: e1mo Date: Thu, 28 Mar 2024 19:01:19 +0100 Subject: python311Packages.parsedmarc: Add missing dependency --- pkgs/development/python-modules/parsedmarc/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index a5c59338fcdc..3655fb833925 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -24,6 +24,7 @@ , mailsuite , msgraph-core , nixosTests +, opensearch-py , publicsuffixlist , pythonOlder , requests @@ -86,6 +87,7 @@ buildPythonPackage rec { tqdm urllib3 xmltodict + opensearch-py ]; # no tests on PyPI, no tags on GitHub -- cgit v1.2.3 From 21ed8adb5e6eb46008a331884d856dd077aa7997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jan 2024 15:30:27 -0800 Subject: python311Packages.parsedmarc: mark broken --- pkgs/development/python-modules/parsedmarc/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index 3655fb833925..b2ae29a124e6 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -110,5 +110,7 @@ buildPythonPackage rec { license = licenses.asl20; maintainers = with maintainers; [ talyz ]; mainProgram = "parsedmarc"; + # https://github.com/domainaware/parsedmarc/issues/464 + broken = lib.versionAtLeast msgraph-core.version "1.0.0"; }; } -- cgit v1.2.3 From 471a8ed428b1734b2ca95358285e8803438d2d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jan 2024 15:31:15 -0800 Subject: parsedmarc: override msgraph-core version --- pkgs/by-name/pa/parsedmarc/package.nix | 41 ++++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 pkgs/by-name/pa/parsedmarc/package.nix diff --git a/pkgs/by-name/pa/parsedmarc/package.nix b/pkgs/by-name/pa/parsedmarc/package.nix new file mode 100644 index 000000000000..fab1e01e8ba4 --- /dev/null +++ b/pkgs/by-name/pa/parsedmarc/package.nix @@ -0,0 +1,41 @@ +{ lib +, python3 +, fetchFromGitHub +}: + +let + python = python3.override { + packageOverrides = self: super: { + # https://github.com/domainaware/parsedmarc/issues/464 + msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec { + version = "0.2.2"; + + src = fetchFromGitHub { + owner = "microsoftgraph"; + repo = "msgraph-sdk-python-core"; + rev = "v${version}"; + hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA="; + }; + + nativeBuildInputs = with self; [ + flit-core + ]; + + propagatedBuildInputs = with self; [ + requests + ]; + + nativeCheckInputs = with self; [ + pytestCheckHook + responses + ]; + + disabledTestPaths = [ + "tests/integration" + ]; + + pythonImportsCheck = [ "msgraph.core" ]; + }); + }; + }; +in with python.pkgs; toPythonApplication parsedmarc diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d228524c591..962cd2146625 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -40062,8 +40062,6 @@ with pkgs; OSCAR = qt5.callPackage ../applications/misc/OSCAR { }; - parsedmarc = with python3Packages; toPythonApplication parsedmarc; - pgmanage = callPackage ../applications/misc/pgmanage { }; pgadmin4 = callPackage ../tools/admin/pgadmin { }; -- cgit v1.2.3 From 1f670eeed324218d7a9e6431aa9bfc244f27ff13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 23 Jan 2024 15:33:08 -0800 Subject: nixos/parsedmarc: use top-level parsedmarc package --- nixos/modules/services/monitoring/parsedmarc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/monitoring/parsedmarc.nix b/nixos/modules/services/monitoring/parsedmarc.nix index 9191a4a697e0..fa15e3b9e9c9 100644 --- a/nixos/modules/services/monitoring/parsedmarc.nix +++ b/nixos/modules/services/monitoring/parsedmarc.nix @@ -438,7 +438,7 @@ in ]; dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{ name = "parsedmarc"; - options.path = "${pkgs.python3Packages.parsedmarc.dashboard}"; + options.path = "${pkgs.parsedmarc.dashboard}"; }]; }; }; @@ -530,7 +530,7 @@ in MemoryDenyWriteExecute = true; LockPersonality = true; SystemCallArchitectures = "native"; - ExecStart = "${pkgs.python3Packages.parsedmarc}/bin/parsedmarc -c /run/parsedmarc/parsedmarc.ini"; + ExecStart = "${lib.getExe pkgs.parsedmarc} -c /run/parsedmarc/parsedmarc.ini"; }; }; -- cgit v1.2.3 From e82299570ee4385cb711267b3daa164116081646 Mon Sep 17 00:00:00 2001 From: e1mo Date: Thu, 28 Mar 2024 19:18:53 +0100 Subject: python311Packages.parsedmarc: switch to pythonRelaxDepsHook and remove unneeded dependency Co-Authored-By: Martin Weinelt --- pkgs/development/python-modules/parsedmarc/default.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index b2ae29a124e6..b9d4df1d58ee 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -27,9 +27,9 @@ , opensearch-py , publicsuffixlist , pythonOlder +, pythonRelaxDepsHook , requests , tqdm -, urllib3 , xmltodict }: @@ -51,14 +51,14 @@ buildPythonPackage rec { hash = "sha256-tK/cxOw50awcDAGRDTQ+Nxb9aJl2+zLZHuJq88xNmXM="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "elasticsearch<7.14.0" "elasticsearch" \ - --replace "elasticsearch-dsl==7.4.0" "elasticsearch-dsl" - ''; - nativeBuildInputs = [ hatchling + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = [ + "elasticsearch" + "elasticsearch-dsl" ]; propagatedBuildInputs = [ @@ -85,7 +85,6 @@ buildPythonPackage rec { publicsuffixlist requests tqdm - urllib3 xmltodict opensearch-py ]; -- cgit v1.2.3 From 896919ded57b9c8fbccc88f2e69cf44a8fe3e356 Mon Sep 17 00:00:00 2001 From: e1mo Date: Thu, 28 Mar 2024 19:25:37 +0100 Subject: nixos/parsedmarc: Fix smtp.to and default elasticsearch url Previously evaluaton would fail if `smtp.to` was not set, since the default case was not handled. With the current versions of the python elasticsearch libraries, any configuration containing the modules default would fail since it's not a valid URL. The issue adressed in #279068 is also adressed, thuse closes #279068. --- nixos/modules/services/monitoring/parsedmarc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/monitoring/parsedmarc.nix b/nixos/modules/services/monitoring/parsedmarc.nix index fa15e3b9e9c9..a14ade59c29e 100644 --- a/nixos/modules/services/monitoring/parsedmarc.nix +++ b/nixos/modules/services/monitoring/parsedmarc.nix @@ -301,7 +301,7 @@ in description = '' The addresses to send outgoing mail to. ''; - apply = x: if x == [] then null else lib.concatStringsSep "," x; + apply = x: if x == [] || x == null then null else lib.concatStringsSep "," x; }; }; @@ -446,7 +446,7 @@ in services.parsedmarc.settings = lib.mkMerge [ (lib.mkIf cfg.provision.elasticsearch { elasticsearch = { - hosts = [ "localhost:9200" ]; + hosts = [ "http://localhost:9200" ]; ssl = false; }; }) -- cgit v1.2.3