1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pyte
6, pexpect
7, ptyprocess
8, jedi
9, git
10, lineedit
11, prompt-toolkit
12, pygments
13, rchitect
14, R
15, rPackages
16, pythonOlder
17}:
18
19buildPythonPackage rec {
20 pname = "radian";
21 version = "0.6.8";
22 format = "setuptools";
23
24 disabled = pythonOlder "3.6";
25
26 src = fetchFromGitHub {
27 owner = "randy3k";
28 repo = pname;
29 rev = "refs/tags/v${version}";
30 hash = "sha256-zI6oUHO4rY/BbbHhvzSNIKCpTDRm0cK46rIKN/ISgY0=";
31 };
32
33 postPatch = ''
34 substituteInPlace setup.py \
35 --replace '"pytest-runner"' ""
36 '';
37
38 nativeBuildInputs = [
39 R # needed at setup time to detect R_HOME
40 ];
41
42 propagatedBuildInputs = [
43 lineedit
44 prompt-toolkit
45 pygments
46 rchitect
47 ] ++ (with rPackages; [
48 reticulate
49 askpass
50 ]);
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 pyte
55 pexpect
56 ptyprocess
57 jedi
58 git
59 ];
60
61 makeWrapperArgs = [ "--set R_HOME ${R}/lib/R" ];
62
63 preCheck = ''
64 export HOME=$TMPDIR
65 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R}/lib/R/lib
66 '';
67
68 pythonImportsCheck = [ "radian" ];
69
70 meta = with lib; {
71 description = "A 21 century R console";
72 homepage = "https://github.com/randy3k/radian";
73 changelog = "https://github.com/randy3k/radian/blob/v${version}/CHANGELOG.md";
74 license = licenses.mit;
75 maintainers = with maintainers; [ savyajha ];
76 };
77}