2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
2022-10-30 15:09:59 +00:00
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, cython
|
|
|
|
, fetchFromGitHub
|
2022-10-30 15:09:59 +00:00
|
|
|
, libiconv
|
2022-10-21 18:38:19 +00:00
|
|
|
, pandas
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
|
|
|
, readstat
|
|
|
|
, zlib
|
|
|
|
}:
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyreadstat";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "1.2.0";
|
2022-10-21 18:38:19 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Roche";
|
|
|
|
repo = "pyreadstat";
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-Rw+v1+KpjSSZoqhlENKcJiaFhAvcNRbZ3+MA2dOsj4Q=";
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
readstat
|
|
|
|
pandas
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyreadstat"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
${python.interpreter} tests/test_basic.py
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-12-28 21:21:41 +00:00
|
|
|
description = "Module to read SAS, SPSS and Stata files into pandas data frames";
|
2022-10-21 18:38:19 +00:00
|
|
|
homepage = "https://github.com/Roche/pyreadstat";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/Roche/pyreadstat/blob/v${version}/change_log.md";
|
2022-10-21 18:38:19 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ swflint ];
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
}
|