From 3e1cc243dbd276d98625e9a4fdf4c4da5af07f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Oct 2025 14:19:31 -0700 Subject: [PATCH 1/3] python3Packages.ntfy-webpush: init at 0.1.3 --- pkgs/by-name/nt/ntfy/package.nix | 2 -- .../python-modules/ntfy-webpush/default.nix} | 8 ++++---- pkgs/top-level/python-packages.nix | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) rename pkgs/{by-name/nt/ntfy/webpush.nix => development/python-modules/ntfy-webpush/default.nix} (82%) diff --git a/pkgs/by-name/nt/ntfy/package.nix b/pkgs/by-name/nt/ntfy/package.nix index 5d2d50e9ae06..4e2d069ea8ff 100644 --- a/pkgs/by-name/nt/ntfy/package.nix +++ b/pkgs/by-name/nt/ntfy/package.nix @@ -16,8 +16,6 @@ let 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; }; diff --git a/pkgs/by-name/nt/ntfy/webpush.nix b/pkgs/development/python-modules/ntfy-webpush/default.nix similarity index 82% rename from pkgs/by-name/nt/ntfy/webpush.nix rename to pkgs/development/python-modules/ntfy-webpush/default.nix index 9c7adcad3981..0aed4f2c10b8 100644 --- a/pkgs/by-name/nt/ntfy/webpush.nix +++ b/pkgs/development/python-modules/ntfy-webpush/default.nix @@ -15,8 +15,8 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "dschep"; repo = "ntfy-webpush"; - rev = "v${version}"; - sha256 = "1dxlvq3glf8yjkn1hdk89rx1s4fi9ygg46yn866a9v7a5a83zx2n"; + tag = "v${version}"; + hash = "sha256-VvQ/kCrq7KSMQdYb8p5P0REdek5oNhjslB45+gbetLc="; }; postPatch = '' @@ -35,10 +35,10 @@ buildPythonPackage rec { # no tests, just a script doCheck = false; - meta = with lib; { + meta = { description = "Cloudbell webpush notification support for ntfy"; homepage = "https://dschep.github.io/ntfy-webpush/"; - license = licenses.mit; + license = lib.licenses.mit; maintainers = [ ]; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a65855a2a2aa..afe90b42eb29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10700,6 +10700,8 @@ self: super: with self; { ntc-templates = callPackage ../development/python-modules/ntc-templates { }; + ntfy-webpush = callPackage ../development/python-modules/ntfy-webpush { }; + ntplib = callPackage ../development/python-modules/ntplib { }; nuclear = callPackage ../development/python-modules/nuclear { }; From 17e2966646c53f91d74490328950cd70d723a5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Oct 2025 14:22:11 -0700 Subject: [PATCH 2/3] ntfy: don't override python3 --- pkgs/by-name/nt/ntfy/package.nix | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/nt/ntfy/package.nix b/pkgs/by-name/nt/ntfy/package.nix index 4e2d069ea8ff..6cefdf6cc280 100644 --- a/pkgs/by-name/nt/ntfy/package.nix +++ b/pkgs/by-name/nt/ntfy/package.nix @@ -1,7 +1,7 @@ { lib, stdenv, - python3, + python3Packages, fetchFromGitHub, fetchpatch, withXmpp ? false, # sleekxmpp doesn't support python 3.10, see https://github.com/dschep/ntfy/issues/266 @@ -12,16 +12,7 @@ withDbus ? stdenv.hostPlatform.isLinux, }: -let - python = python3.override { - self = python; - packageOverrides = self: super: { - # databases, on which slack-sdk depends, is incompatible with SQLAlchemy 2.0 - sqlalchemy = super.sqlalchemy_1_4; - }; - }; -in -python.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "ntfy"; version = "2.7.0"; @@ -74,10 +65,10 @@ python.pkgs.buildPythonApplication rec { --replace-fail "':sys_platform == \"darwin\"'" "'darwin'" ''; - build-system = with python.pkgs; [ setuptools ]; + build-system = with python3Packages; [ setuptools ]; dependencies = - with python.pkgs; + with python3Packages; ( [ requests @@ -106,7 +97,7 @@ python.pkgs.buildPythonApplication rec { ] ); - nativeCheckInputs = with python.pkgs; [ + nativeCheckInputs = with python3Packages; [ mock pytestCheckHook ]; From 6942d8e4ef1ae6a3c23c3186bcf8ffe96fe46796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Oct 2025 15:12:20 -0700 Subject: [PATCH 3/3] ntfy: 2.7.0 -> 2.7.1 Diff: https://github.com/dschep/ntfy/compare/v2.7.0...v2.7.1 Changelog: https://github.com/dschep/ntfy/releases/tag/v2.7.1 --- pkgs/by-name/nt/ntfy/package.nix | 60 ++++++++------------------------ 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/pkgs/by-name/nt/ntfy/package.nix b/pkgs/by-name/nt/ntfy/package.nix index 6cefdf6cc280..d21624f41393 100644 --- a/pkgs/by-name/nt/ntfy/package.nix +++ b/pkgs/by-name/nt/ntfy/package.nix @@ -3,7 +3,7 @@ stdenv, python3Packages, fetchFromGitHub, - fetchpatch, + writableTmpDirAsHomeHook, withXmpp ? false, # sleekxmpp doesn't support python 3.10, see https://github.com/dschep/ntfy/issues/266 withMatrix ? true, withSlack ? true, @@ -14,51 +14,17 @@ python3Packages.buildPythonApplication rec { pname = "ntfy"; - version = "2.7.0"; + version = "2.7.1"; pyproject = true; src = fetchFromGitHub { owner = "dschep"; repo = "ntfy"; - rev = "v${version}"; - sha256 = "09f02cn4i1l2aksb3azwfb70axqhn7d0d0vl2r6640hqr74nc1cv"; + tag = "v${version}"; + hash = "sha256-EIhoZ2tFJQOc5PyRCazwRhldFxQb65y6h+vYPwV7ReE="; }; - 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="; - }) - ]; - postPatch = '' # We disable the Darwin specific things because it relies on pyobjc, which we don't have. substituteInPlace setup.py \ @@ -100,27 +66,29 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = with python3Packages; [ mock pytestCheckHook + writableTmpDirAsHomeHook ]; disabledTests = [ + # AssertionError: {'backends': ['default']} != {} + "test_default_config" + ] + ++ lib.optionals (!withXmpp) [ "test_xmpp" ]; - disabledTestPaths = [ + disabledTestPaths = lib.optionals (!withXmpp) [ "tests/test_xmpp.py" ]; - preCheck = '' - export HOME=$(mktemp -d) - ''; - pythonImportsCheck = [ "ntfy" ]; - meta = with lib; { + meta = { + changelog = "https://github.com/dschep/ntfy/releases/tag/${src.tag}"; description = "Utility for sending notifications, on demand and when commands finish"; homepage = "https://ntfy.readthedocs.io/en/latest/"; - license = licenses.gpl3; - maintainers = with maintainers; [ kamilchm ]; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ kamilchm ]; mainProgram = "ntfy"; }; }