summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyreadstat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyreadstat/default.nix')
-rw-r--r--pkgs/development/python-modules/pyreadstat/default.nix41
1 files changed, 34 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/pyreadstat/default.nix b/pkgs/development/python-modules/pyreadstat/default.nix
index 499aa97db8c..4992d260471 100644
--- a/pkgs/development/python-modules/pyreadstat/default.nix
+++ b/pkgs/development/python-modules/pyreadstat/default.nix
@@ -1,14 +1,26 @@
-{ lib, buildPythonPackage, fetchFromGitHub, cython, zlib, pandas, readstat }:
+{ lib
+, buildPythonPackage
+, cython
+, fetchFromGitHub
+, pandas
+, python
+, pythonOlder
+, readstat
+, zlib
+}:
 
 buildPythonPackage rec {
   pname = "pyreadstat";
   version = "1.1.9";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "Roche";
     repo = "pyreadstat";
     rev = "v${version}";
-    sha256 = "16aa16ybh3ikmlxsg8zm19x9k6r4gpd0sxqagv318w76jjyw1nrs";
+    hash = "sha256-OtvAvZTmcBTGfgp3Ddp9JJuZegr1o6c7rTMOuLwJSpk=";
   };
 
   nativeBuildInputs = [
@@ -24,11 +36,26 @@ buildPythonPackage rec {
     pandas
   ];
 
-  meta = {
-    homepage = "https://github.com/Roche/pyreadstat";
+  pythonImportsCheck = [
+    "pyreadstat"
+  ];
+
+  preCheck = ''
+    export HOME=$(mktemp -d);
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    ${python.interpreter} tests/test_basic.py
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
     description = "Python package to read SAS, SPSS and Stata files into pandas data frames using the readstat C library";
-    license = lib.licenses.asl20;
-    maintainers = with lib.maintainers; [ swflint ];
+    homepage = "https://github.com/Roche/pyreadstat";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ swflint ];
   };
-
 }