1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 cython, 6 fetchFromGitHub, 7 libiconv, 8 pandas, 9 python, 10 pythonOlder, 11 readstat, 12 setuptools, 13 zlib, 14}: 15 16buildPythonPackage rec { 17 pname = "pyreadstat"; 18 version = "1.2.8"; 19 pyproject = true; 20 21 disabled = pythonOlder "3.7"; 22 23 src = fetchFromGitHub { 24 owner = "Roche"; 25 repo = "pyreadstat"; 26 tag = "v${version}"; 27 hash = "sha256-9uDmkEp9CXUCcM09CaVaaG856Q1rY3sKYOkQkGRzakE="; 28 }; 29 30 build-system = [ 31 cython 32 setuptools 33 ]; 34 35 buildInputs = [ zlib ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; 36 37 dependencies = [ 38 readstat 39 pandas 40 ]; 41 42 pythonImportsCheck = [ "pyreadstat" ]; 43 44 preCheck = '' 45 export HOME=$(mktemp -d); 46 ''; 47 48 checkPhase = '' 49 runHook preCheck 50 51 ${python.interpreter} tests/test_basic.py 52 53 runHook postCheck 54 ''; 55 56 meta = with lib; { 57 description = "Module to read SAS, SPSS and Stata files into pandas data frames"; 58 homepage = "https://github.com/Roche/pyreadstat"; 59 changelog = "https://github.com/Roche/pyreadstat/blob/v${version}/change_log.md"; 60 license = licenses.asl20; 61 maintainers = with maintainers; [ swflint ]; 62 }; 63}