about summary refs log tree commit diff
path: root/pkgs/development/python-modules/enocean/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/enocean/default.nix')
-rw-r--r--pkgs/development/python-modules/enocean/default.nix48
1 files changed, 26 insertions, 22 deletions
diff --git a/pkgs/development/python-modules/enocean/default.nix b/pkgs/development/python-modules/enocean/default.nix
index 925c87ed3f8eb..eeef7703dd926 100644
--- a/pkgs/development/python-modules/enocean/default.nix
+++ b/pkgs/development/python-modules/enocean/default.nix
@@ -1,41 +1,44 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, beautifulsoup4
-, enum-compat
-, pyserial
-, pynose
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  fetchpatch2,
+  setuptools,
+  beautifulsoup4,
+  enum-compat,
+  pyserial,
+  pytestCheckHook,
 }:
 
 buildPythonPackage rec {
   pname = "enocean";
   version = "0.60.1";
-  format = "setuptools";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "kipe";
     repo = "enocean";
-    rev = version;
-    sha256 = "0cbcvvy3qaqv8925z608qmkc1l914crzw79krwrz2vpm2fyribab";
+    rev = "refs/tags/${version}";
+    hash = "sha256-S62YvRP1bvEzzzMd/jMjIdHAZsUImF9EQhsrPPzebDE=";
   };
 
-  propagatedBuildInputs = [
+  patches = [
+    (fetchpatch2 {
+      name = "replace-nose-with-pytest.patch";
+      url = "https://github.com/kipe/enocean/commit/e5ca3b70f0920f129219c980ad549d7f3a4576de.patch";
+      hash = "sha256-cDBvI0I4W5YkGTpg+rKy08TUAmKlhKa/5+Muou9iArs=";
+    })
+  ];
+
+  build-system = [ setuptools ];
+
+  dependencies = [
     beautifulsoup4
     enum-compat
     pyserial
   ];
 
-  nativeCheckInputs = [
-    pynose
-  ];
-
-  checkPhase = ''
-    runHook preCheck
-
-    nosetests
-
-    runHook postCheck
-  '';
+  nativeCheckInputs = [ pytestCheckHook ];
 
   pythonImportsCheck = [
     "enocean.communicators"
@@ -44,6 +47,7 @@ buildPythonPackage rec {
   ];
 
   meta = with lib; {
+    changelog = "https://github.com/kipe/enocean/releases/tag/${version}";
     description = "EnOcean serial protocol implementation";
     mainProgram = "enocean_example.py";
     homepage = "https://github.com/kipe/enocean";