depot/third_party/nixpkgs/pkgs/development/python-modules/radian/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

77 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pyte
, pexpect
, ptyprocess
, jedi
, git
, lineedit
, prompt-toolkit
, pygments
, rchitect
, R
, rPackages
, pythonOlder
}:
buildPythonPackage rec {
pname = "radian";
version = "0.6.7";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "randy3k";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-MEstbQj1dOcrukgDvMwL330L9INEZcIupebrSYMOrZk=";
};
postPatch = ''
substituteInPlace setup.py \
--replace '"pytest-runner"' ""
'';
nativeBuildInputs = [
R # needed at setup time to detect R_HOME
];
propagatedBuildInputs = [
lineedit
prompt-toolkit
pygments
rchitect
] ++ (with rPackages; [
reticulate
askpass
]);
nativeCheckInputs = [
pytestCheckHook
pyte
pexpect
ptyprocess
jedi
git
];
makeWrapperArgs = [ "--set R_HOME ${R}/lib/R" ];
preCheck = ''
export HOME=$TMPDIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R}/lib/R/lib
'';
pythonImportsCheck = [ "radian" ];
meta = with lib; {
description = "A 21 century R console";
homepage = "https://github.com/randy3k/radian";
changelog = "https://github.com/randy3k/radian/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ savyajha ];
};
}