about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-22 10:43:06 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-11 16:17:56 +0000
commitca1aada113c0ebda1ab8667199f6453f8e01c4fc (patch)
tree55e402280096f62eb0bc8bcad5ce6050c5a0aec7 /nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix
parente4df5a52a6a6531f32626f57205356a773ac2975 (diff)
parent93883402a445ad467320925a0a5dbe43a949f25b (diff)
downloadnixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.gz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.bz2
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.lz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.xz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.zst
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.zip
Merge commit '93883402a445ad467320925a0a5dbe43a949f25b'
Conflicts:
	nixpkgs/nixos/modules/programs/ssh.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/data/fonts/noto-fonts/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/libraries/mesa/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix46
1 files changed, 36 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix b/nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix
index 336c6b2e5134..a20d0c696cd6 100644
--- a/nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/batchgenerators/default.nix
@@ -1,12 +1,12 @@
 { lib
 , buildPythonPackage
-, isPy27
+, pythonOlder
 , fetchFromGitHub
 , pytestCheckHook
-, unittest2
 , future
 , numpy
 , pillow
+, fetchpatch
 , scipy
 , scikit-learn
 , scikitimage
@@ -16,27 +16,53 @@
 buildPythonPackage rec {
   pname = "batchgenerators";
   version = "0.21";
+  format = "setuptools";
 
-  disabled = isPy27;
+  disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "MIC-DKFZ";
     repo = pname;
     rev = "v${version}";
-    sha256 = "16bk4r0q3m2c9fawpmj4l7kz0x3fyv1spb92grf44gmyricq3jdb";
-
+    hash = "sha256-q8mBWcy+PkJcfiKtq8P2bnTw56FE1suVS0zUgUEmc5k=";
   };
 
   propagatedBuildInputs = [
-    future numpy pillow scipy scikit-learn scikitimage threadpoolctl
+    future
+    numpy
+    pillow
+    scipy
+    scikit-learn
+    scikitimage
+    threadpoolctl
+  ];
+
+  checkInputs = [
+    pytestCheckHook
   ];
 
-  checkInputs = [ pytestCheckHook unittest2 ];
+  patches = [
+    # Remove deprecated unittest2, https://github.com/MIC-DKFZ/batchgenerators/pull/78
+    (fetchpatch {
+      name = "remove-unittest2.patch";
+      url = "https://github.com/MIC-DKFZ/batchgenerators/commit/87a9437057df8a7550aa3b3eaf840871cc0d5cef.patch";
+      sha256 = "sha256-vozBK7g2dLxx9din/R2vU28Mm+LoGAO/BmQlt/ShmEo=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace '"unittest2",' ""
+  '';
+
+  pythonImportsCheck = [
+    "batchgenerators"
+  ];
 
-  meta = {
+  meta = with lib; {
     description = "2D and 3D image data augmentation for deep learning";
     homepage = "https://github.com/MIC-DKFZ/batchgenerators";
-    license = lib.licenses.asl20;
-    maintainers = with lib.maintainers; [ bcdarwin ];
+    license = licenses.asl20;
+    maintainers = with maintainers; [ bcdarwin ];
   };
 }