From f4fddb238d0a242c2c6e7380c253030cc5d05489 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Tue, 23 Apr 2024 00:41:54 +0200 Subject: [PATCH] python312Packages.pynotifier: init at 0.5.0 --- .../python-modules/pynotifier/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/pynotifier/default.nix diff --git a/pkgs/development/python-modules/pynotifier/default.nix b/pkgs/development/python-modules/pynotifier/default.nix new file mode 100644 index 000000000000..7968677f1b62 --- /dev/null +++ b/pkgs/development/python-modules/pynotifier/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, libnotify +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pynotifier"; + version = "0.5.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "YuriyLisovskiy"; + repo = "pynotifier"; + rev = version; + hash = "sha256-xS3hH3cyqgDD7uoWkIYXpQAh7SN7XJ/qMfB0Vq5bva0="; + }; + + postPatch = '' + substituteInPlace pynotifier/backends/platform/linux.py \ + --replace-fail \ + 'shutil.which("notify-send")' \ + '"${lib.getExe' libnotify "notify-send"}"' + ''; + + nativeBuildInputs = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "pynotifier" ]; + + meta = with lib; { + description = "Module for sending notifications"; + homepage = "https://github.com/YuriyLisovskiy/pynotifier"; + license = licenses.mit; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a990c83f6d8..0ee5eaa557b4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9910,6 +9910,8 @@ self: super: with self; { pynose = callPackage ../development/python-modules/pynose { }; + pynotifier = callPackage ../development/python-modules/pynotifier { }; + pynuki = callPackage ../development/python-modules/pynuki { }; pynut2 = callPackage ../development/python-modules/pynut2 { };