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
|
2023-11-16 04:20:00 +00:00
|
|
|
, cython_3
|
2022-10-21 18:38:19 +00:00
|
|
|
, 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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.2.6";
|
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}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-VcPpGRrE/5udNijodO88Lw69JPOm6ZN7BZb4xD34srQ=";
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
cython_3
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|