summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRakesh Gupta <rakeshgupta4u@gmail.com>2019-12-20 16:17:01 +1100
committerJon <jonringer@users.noreply.github.com>2020-01-06 22:51:05 -0800
commitf4127254492fd1e99307dd836a0fee93c82b0425 (patch)
treed3301b28a7ca6c3e7f0d6be6c6048dce3a0bd16d /pkgs
parentddcaa0cd2f20eefbb79818132c3215678d68d260 (diff)
downloadnixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar.gz
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar.bz2
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar.lz
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar.xz
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.tar.zst
nixpkgs-f4127254492fd1e99307dd836a0fee93c82b0425.zip
pythonPackages.imgaug: 0.3.0-patch
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/imgaug/default.nix45
1 files changed, 35 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/imgaug/default.nix b/pkgs/development/python-modules/imgaug/default.nix
index 32dc23ddfce..48ea6004426 100644
--- a/pkgs/development/python-modules/imgaug/default.nix
+++ b/pkgs/development/python-modules/imgaug/default.nix
@@ -1,30 +1,55 @@
-{ stdenv, buildPythonPackage, fetchPypi, numpy, scipy, scikitimage, opencv3, six }:
+{ buildPythonPackage
+, fetchurl
+, imageio
+, numpy
+, opencv3
+, pytest
+, scikitimage
+, scipy
+, shapely
+, six
+, stdenv
+}:
 
 buildPythonPackage rec {
   pname = "imgaug";
   version = "0.3.0";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "e1354d41921f1b306b50c5141b4870f17e81b531cae2f5c3093da9dc4dcb3cf4";
+  src = fetchurl {
+    url = "https://github.com/aleju/imgaug/archive/c3d99a420efc45652a1264920dc20378a54b1325.zip";
+    sha256 = "sha256:174nvhyhdn3vz0i34rqmkn26840j3mnfr55cvv5bdf9l4y9bbjq2";
   };
 
+  postPatch = ''
+    substituteInPlace requirements.txt \
+      --replace "opencv-python-headless" ""
+    substituteInPlace setup.py \
+      --replace "opencv-python-headless" "" 
+    substituteInPlace pytest.ini \
+      --replace "--xdoctest --xdoctest-global-exec=\"import imgaug as ia\nfrom imgaug import augmenters as iaa\"" ""
+  '';
+
   propagatedBuildInputs = [
+    imageio
     numpy
-    scipy
-    scikitimage
     opencv3
+    scikitimage
+    scipy
+    shapely
     six
   ];
 
-  # disable tests when there are no tests in the PyPI archive
-  doCheck = false;
+  checkPhase = ''
+     pytest ./test
+  '';
+
+  checkInputs = [ opencv3 pytest ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/aleju/imgaug;
     description = "Image augmentation for machine learning experiments";
     license = licenses.mit;
-    maintainers = with maintainers; [ cmcdragonkai ];
-    broken = true; # opencv-python bindings aren't available yet, and look non-trivial
+    maintainers = with maintainers; [ cmcdragonkai rakesh4g ];
+    platforms = platforms.linux;
   };
 }