about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/cnvkit/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/python-modules/cnvkit/default.nix
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/cnvkit/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/cnvkit/default.nix33
1 files changed, 28 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/cnvkit/default.nix b/nixpkgs/pkgs/development/python-modules/cnvkit/default.nix
index 6677ab06334f..92af67fa183a 100644
--- a/nixpkgs/pkgs/development/python-modules/cnvkit/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/cnvkit/default.nix
@@ -1,5 +1,6 @@
 { lib
-, fetchPypi
+, fetchFromGitHub
+, fetchpatch
 , rPackages
 , rWrapper
 , buildPythonPackage
@@ -15,17 +16,29 @@
 , pillow
 , pomegranate
 , pyfaidx
+, python
+, R
 }:
 
 buildPythonPackage rec {
   pname = "CNVkit";
   version = "0.9.7";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "d68adc0121e17c61a3aa28c0a9ba6526510a5a0df0f0a6eb1818bab71b7e927a";
+  src = fetchFromGitHub {
+    owner = "etal";
+    repo = "cnvkit";
+    rev = "v${version}";
+    sha256 = "022zplgqil5l76vri647cyjx427vnbg5r2gw6lw712d2janvdjm7";
   };
 
+  patches = [
+    # Fix: AttributeError: module 'pandas.io.common' has no attribute 'EmptyDataError'
+    (fetchpatch {
+      url = "https://github.com/etal/cnvkit/commit/392adfffedfa0415e635b72c5027835b0a8d7ab5.patch";
+      sha256 = "0s0gwyy0hybmhc3jij2v9l44b6lkcmclii8bkwsazzj2kc24m2rh";
+    })
+  ];
+
   propagatedBuildInputs = [
     biopython
     numpy
@@ -39,6 +52,7 @@ buildPythonPackage rec {
     future
     pillow
     pomegranate
+    rPackages.DNAcopy
   ];
 
   postPatch = ''
@@ -46,7 +60,16 @@ buildPythonPackage rec {
       --replace "pandas >= 0.20.1, < 0.25.0" "pandas"
   '';
 
-  pythonImportsCheck = [ "cnvlib" ];
+  checkInputs = [ R ];
+
+  checkPhase = ''
+    pushd test/
+    ${python.interpreter} test_io.py
+    ${python.interpreter} test_genome.py
+    ${python.interpreter} test_cnvlib.py
+    ${python.interpreter} test_commands.py
+    ${python.interpreter} test_r.py
+  '';
 
   meta = with lib; {
     homepage = "https://cnvkit.readthedocs.io";