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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.2.2";
|
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}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-CvovylOTTyXm0ucTwNSFZzkcA0H8H76BSg4vjB2Pe4M=";
|
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
|
|
|
};
|
|
|
|
}
|