about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/seabreeze/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/seabreeze/default.nix38
1 files changed, 23 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix b/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix
index 9101c654b9c6..78750d84b24f 100644
--- a/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/seabreeze/default.nix
@@ -1,13 +1,21 @@
 { lib
 , fetchFromGitHub
 , buildPythonPackage
-, cython
+
+# build-system
+, cython_3
 , git
 , pkgconfig
+, setuptools
 , setuptools-scm
-, future
+
+# dependneices
 , numpy
+
+# optional-dependenices
 , pyusb
+
+# tests
 , mock
 , pytestCheckHook
 , zipp
@@ -20,35 +28,35 @@
 
 buildPythonPackage rec {
   pname = "seabreeze";
-  version = "1.3.0";
-  format = "setuptools";
+  version = "2.5.0";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "ap--";
     repo = "python-seabreeze";
-    rev = "v${version}";
-    sha256 = "1hm9aalpb9sdp8s7ckn75xvyiacp5678pv9maybm5nz0z2h29ibq";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-25rFGpfwJKj9lLDO/ZsqJ2NfCsgSSJghLZxffjX/+7w=";
     leaveDotGit = true;
   };
 
-  postPatch = ''
-    substituteInPlace setup.py \
-      --replace '"pytest-runner",' ""
-  '';
-
   nativeBuildInputs = [
-    cython
+    cython_3
     git
     pkgconfig
+    setuptools
     setuptools-scm
   ];
 
   propagatedBuildInputs = [
-    future
     numpy
-    pyusb
   ];
 
+  passthru.optional-dependencies = {
+    pyseabreeze = [
+      pyusb
+    ];
+  };
+
   postInstall = ''
     mkdir -p $out/etc/udev/rules.d
     cp os_support/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
@@ -59,7 +67,7 @@ buildPythonPackage rec {
     pytestCheckHook
     mock
     zipp
-  ];
+  ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
 
   setupPyBuildFlags = [ "--without-cseabreeze" ];