From a18238984e9f667a3491e7e88477d13aafc8b10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Jan 2025 18:59:54 +0100 Subject: [PATCH 1/4] python313Packages.moto: fix typo --- pkgs/development/python-modules/moto/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index 8ac8f71ecbdf..ae1f5d634309 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -227,7 +227,7 @@ buildPythonPackage rec { # AssertionError: assert ResourceWarning not in [, ] "test_delete_object_with_version" - # KeyError beucase of ap-southeast-5-apse5-az + # KeyError because of ap-southeast-5-apse5-az "test_zoneId_in_availability_zones" # Parameter validation fails From 002d82c95fdc43b69b58357791fe4474c0160b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Jan 2025 19:00:32 +0100 Subject: [PATCH 2/4] ntfy: switch to default python, disable xmpp support by default, also switch to pytestCheckHook sleekxmpp doesn't support python 3.10 or later, so just disable it. Also dropped the django_3 override. That doesn't seem to be necessary at this point anymore. --- pkgs/tools/misc/ntfy/default.nix | 84 ++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/pkgs/tools/misc/ntfy/default.nix b/pkgs/tools/misc/ntfy/default.nix index c79ca23e1b5e..a37df5d36377 100644 --- a/pkgs/tools/misc/ntfy/default.nix +++ b/pkgs/tools/misc/ntfy/default.nix @@ -1,10 +1,10 @@ { lib, stdenv, - python39, + python3, fetchFromGitHub, fetchpatch, - withXmpp ? !stdenv.hostPlatform.isDarwin, + withXmpp ? false, # sleekxmpp doesn't support python 3.10, see https://github.com/dschep/ntfy/issues/266 withMatrix ? true, withSlack ? true, withEmoji ? true, @@ -13,15 +13,13 @@ }: let - python = python39.override { + python = python3.override { self = python; packageOverrides = self: super: { ntfy-webpush = self.callPackage ./webpush.nix { }; # databases, on which slack-sdk depends, is incompatible with SQLAlchemy 2.0 sqlalchemy = super.sqlalchemy_1_4; - - django = super.django_3; }; }; in @@ -38,11 +36,47 @@ python.pkgs.buildPythonApplication rec { sha256 = "09f02cn4i1l2aksb3azwfb70axqhn7d0d0vl2r6640hqr74nc1cv"; }; - nativeCheckInputs = with python.pkgs; [ - mock + patches = [ + # Fix Slack integration no longer working. + # From https://github.com/dschep/ntfy/pull/229 - "Swap Slacker for Slack SDK" + (fetchpatch { + name = "ntfy-Swap-Slacker-for-Slack-SDK.patch"; + url = "https://github.com/dschep/ntfy/commit/2346e7cfdca84c8f1afc7462a92145c1789deb3e.patch"; + sha256 = "13k7jbsdx0jx7l5s8whirric76hml5bznkfcxab5xdp88q52kpk7"; + }) + # Add compatibility with emoji 2.0 + # https://github.com/dschep/ntfy/pull/250 + (fetchpatch { + name = "ntfy-Add-compatibility-with-emoji-2.0.patch"; + url = "https://github.com/dschep/ntfy/commit/4128942bb7a706117e7154a50a73b88f531631fe.patch"; + sha256 = "sha256-V8dIy/K957CPFQQS1trSI3gZOjOcVNQLgdWY7g17bRw="; + }) + # Change getargspec to getfullargspec for python 3.11 compatibility + (fetchpatch { + url = "https://github.com/dschep/ntfy/commit/71be9766ea041d2df6ebbce2781f980eea002852.patch"; + hash = "sha256-6OChaTj4g3gxVDScc/JksBISHuq+5fbNQregchSXYaQ="; + }) + # Fix compatibility with Python 3.11 + # https://github.com/dschep/ntfy/pull/271 + (fetchpatch { + url = "https://github.com/dschep/ntfy/pull/271/commits/444b60bec7de474d029cac184e82885011dd1474.patch"; + hash = "sha256-PKTu8cOpws1z6f1T4uIi2iCJAoAwu+X0Pe7XnHYtHuI="; + }) + # Fix compatibility with Python 3.12 + # https://github.com/dschep/ntfy/pull/271 + (fetchpatch { + url = "https://github.com/dschep/ntfy/pull/271/commits/d49ab9f9dba4966a44b5f0c6911741edabd35f6b.patch"; + hash = "sha256-qTUWMS8EXWYCK/ZL0Us7iJp62UIKwYT1BqDy59832ig="; + }) ]; - propagatedBuildInputs = + postPatch = '' + # We disable the Darwin specific things because it relies on pyobjc, which we don't have. + substituteInPlace setup.py \ + --replace "':sys_platform == \"darwin\"'" "'darwin'" + ''; + + dependencies = with python.pkgs; ( [ @@ -72,31 +106,21 @@ python.pkgs.buildPythonApplication rec { ]) ); - patches = [ - # Fix Slack integration no longer working. - # From https://github.com/dschep/ntfy/pull/229 - "Swap Slacker for Slack SDK" - (fetchpatch { - name = "ntfy-Swap-Slacker-for-Slack-SDK.patch"; - url = "https://github.com/dschep/ntfy/commit/2346e7cfdca84c8f1afc7462a92145c1789deb3e.patch"; - sha256 = "13k7jbsdx0jx7l5s8whirric76hml5bznkfcxab5xdp88q52kpk7"; - }) - # Add compatibility with emoji 2.0 - # https://github.com/dschep/ntfy/pull/250 - (fetchpatch { - name = "ntfy-Add-compatibility-with-emoji-2.0.patch"; - url = "https://github.com/dschep/ntfy/commit/4128942bb7a706117e7154a50a73b88f531631fe.patch"; - sha256 = "sha256-V8dIy/K957CPFQQS1trSI3gZOjOcVNQLgdWY7g17bRw="; - }) + nativeCheckInputs = with python.pkgs; [ + mock + pytestCheckHook ]; - postPatch = '' - # We disable the Darwin specific things because it relies on pyobjc, which we don't have. - substituteInPlace setup.py \ - --replace "':sys_platform == \"darwin\"'" "'darwin'" - ''; + disabledTests = [ + "test_xmpp" + ]; - checkPhase = '' - HOME=$(mktemp -d) ${python.interpreter} setup.py test + disabledTestPaths = [ + "tests/test_xmpp.py" + ]; + + preCheck = '' + export HOME=$(mktemp -d) ''; meta = with lib; { From 629e9feaae4d584ca7a1cab2047c2e9e60b12d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Jan 2025 19:01:04 +0100 Subject: [PATCH 3/4] ntfy: drop optional brackets --- pkgs/tools/misc/ntfy/default.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/misc/ntfy/default.nix b/pkgs/tools/misc/ntfy/default.nix index a37df5d36377..3a79df2eae56 100644 --- a/pkgs/tools/misc/ntfy/default.nix +++ b/pkgs/tools/misc/ntfy/default.nix @@ -85,25 +85,25 @@ python.pkgs.buildPythonApplication rec { appdirs ntfy-webpush ] - ++ (lib.optionals withXmpp [ + ++ lib.optionals withXmpp [ sleekxmpp dnspython - ]) - ++ (lib.optionals withMatrix [ + ] + ++ lib.optionals withMatrix [ matrix-client - ]) - ++ (lib.optionals withSlack [ + ] + ++ lib.optionals withSlack [ slack-sdk - ]) - ++ (lib.optionals withEmoji [ + ] + ++ lib.optionals withEmoji [ emoji - ]) - ++ (lib.optionals withPid [ + ] + ++ lib.optionals withPid [ psutil - ]) - ++ (lib.optionals withDbus [ + ] + ++ lib.optionals withDbus [ dbus-python - ]) + ] ); nativeCheckInputs = with python.pkgs; [ From 736314654d0ede857a249cb06ae7afaea8bcd185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Jan 2025 19:01:10 +0100 Subject: [PATCH 4/4] ntfy: use https in meta.homepage --- pkgs/tools/misc/ntfy/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/misc/ntfy/default.nix b/pkgs/tools/misc/ntfy/default.nix index 3a79df2eae56..5cb782c08d04 100644 --- a/pkgs/tools/misc/ntfy/default.nix +++ b/pkgs/tools/misc/ntfy/default.nix @@ -125,7 +125,7 @@ python.pkgs.buildPythonApplication rec { meta = with lib; { description = "Utility for sending notifications, on demand and when commands finish"; - homepage = "http://ntfy.rtfd.org/"; + homepage = "https://ntfy.rtfd.org/"; license = licenses.gpl3; maintainers = with maintainers; [ kamilchm ]; mainProgram = "ntfy";