about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2024-05-12 17:20:40 +0200
committerGitHub <noreply@github.com>2024-05-12 17:20:40 +0200
commit3cec523c2f52cfa642cafeed4b1817b709f0f616 (patch)
tree821f86a68942c69bfb7f4cd0467d6721a78f73cb
parent239689b70ca1fbe86e398c7f63087c197dfc2364 (diff)
parent333fdca4ddcf4e42ce86cdf70c255d409450fc79 (diff)
Merge pull request #311056 from mweinelt/pull-that-nose
Migrate packages from nosetests
-rw-r--r--pkgs/development/python-modules/ansible-runner/default.nix5
-rw-r--r--pkgs/development/python-modules/hid/default.nix28
-rw-r--r--pkgs/development/python-modules/lockfile/default.nix15
-rw-r--r--pkgs/development/python-modules/opuslib/default.nix17
4 files changed, 47 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/ansible-runner/default.nix b/pkgs/development/python-modules/ansible-runner/default.nix
index ae77ab3594bed..b0145a3113eea 100644
--- a/pkgs/development/python-modules/ansible-runner/default.nix
+++ b/pkgs/development/python-modules/ansible-runner/default.nix
@@ -41,6 +41,11 @@ buildPythonPackage rec {
       hash = "sha256-eTnQkftvjK0YHU+ovotRVSuVlvaVeXp5SvYk1DPCg88=";
       excludes = [ ".github/workflows/ci.yml" "tox.ini" ];
     })
+    (fetchpatch {
+      # python 3.12 compat
+      url = "https://github.com/ansible/ansible-runner/commit/dc248497bb2375a363222ce755bf3a31f21d5f64.patch";
+      hash = "sha256-QT28Iw0uENoO35rqZpYBcmJB/GNDEF4m86SKf6p0XQU=";
+    })
   ];
 
   build-system = [
diff --git a/pkgs/development/python-modules/hid/default.nix b/pkgs/development/python-modules/hid/default.nix
index deb4006dfe78a..7c33cb5b9d3c5 100644
--- a/pkgs/development/python-modules/hid/default.nix
+++ b/pkgs/development/python-modules/hid/default.nix
@@ -1,30 +1,40 @@
 { lib
 , buildPythonPackage
 , fetchPypi
+, setuptools
 , hidapi
-, nose
 }:
 
 buildPythonPackage rec {
   pname = "hid";
   version = "1.0.6";
-  format = "setuptools";
+  pyproject = true;
 
   src = fetchPypi {
     inherit pname version;
     hash = "sha256-SNdk166XRroSO5bb9FeJPKgCaLd5HEsdLgUTEO64OGA=";
   };
 
-  propagatedBuildInputs = [ hidapi ];
-
-  nativeCheckInputs = [ nose ];
-
  postPatch = ''
-    hidapi=${hidapi}/lib/
-    test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
-    sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
+   hidapi=${hidapi}/lib/
+   test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
+   sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
   '';
 
+  build-system = [
+    setuptools
+  ];
+
+  dependencies = [
+    hidapi
+  ];
+
+  doCheck = false; # no tests
+
+  pythonImportsCheck = [
+    "hid"
+  ];
+
   meta = with lib; {
     description = "hidapi bindings in ctypes";
     homepage = "https://github.com/apmorton/pyhidapi";
diff --git a/pkgs/development/python-modules/lockfile/default.nix b/pkgs/development/python-modules/lockfile/default.nix
index 0fb64ad0baf9f..1ee92f4ce38af 100644
--- a/pkgs/development/python-modules/lockfile/default.nix
+++ b/pkgs/development/python-modules/lockfile/default.nix
@@ -1,25 +1,32 @@
 { lib
 , buildPythonPackage
 , fetchPypi
+, setuptools
 , pbr
-, nose
+, pynose
 }:
 
 buildPythonPackage rec {
   pname = "lockfile";
   version = "0.12.2";
-  format = "setuptools";
+  pyproject = true;
 
   src = fetchPypi {
     inherit pname version;
     sha256 = "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799";
   };
 
-  buildInputs = [ pbr ];
-  nativeCheckInputs = [ nose ];
+  build-system = [
+    pbr
+    setuptools
+  ];
+
+  nativeCheckInputs = [ pynose ];
 
   checkPhase = ''
+    runHook preCheck
     nosetests
+    runHook postcheck
   '';
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/opuslib/default.nix b/pkgs/development/python-modules/opuslib/default.nix
index c30d708511866..2f5bbf8b2581d 100644
--- a/pkgs/development/python-modules/opuslib/default.nix
+++ b/pkgs/development/python-modules/opuslib/default.nix
@@ -1,17 +1,20 @@
-{ buildPythonPackage,
+{
+  buildPythonPackage,
   fetchFromGitHub,
   fetchpatch,
   isPy27,
   libopus,
-  nose,
-  lib, stdenv,
+  pynose,
+  lib,
+  stdenv,
   substituteAll,
+  setuptools,
 }:
 
 buildPythonPackage rec {
   pname = "opuslib";
   version = "3.0.3";
-  format = "setuptools";
+  pyproject = true;
 
   disabled = isPy27;
 
@@ -41,7 +44,11 @@ buildPythonPackage rec {
     })
   ];
 
-  nativeCheckInputs = [ nose ];
+  build-system = [
+    setuptools
+  ];
+
+  nativeCheckInputs = [ pynose ];
 
   meta = with lib; {
     description = "Python bindings to the libopus, IETF low-delay audio codec";