1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cffi
5, pytestCheckHook
6, pytest-mock
7, pythonOlder
8, R
9, rPackages
10, six
11}:
12
13buildPythonPackage rec {
14 pname = "rchitect";
15 version = "0.4.4";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "randy3k";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-igrYMgPemYVGDR+eWiqtxFxFjroCyOfKEU0wj8D7ZS8=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace '"pytest-runner"' ""
30 '';
31
32 propagatedBuildInputs = [
33 cffi
34 six
35 ] ++ (with rPackages; [
36 reticulate
37 ]);
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 pytest-mock
42 R
43 ];
44
45 preCheck = ''
46 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R}/lib/R/lib
47 cd $TMPDIR
48 '';
49
50 pythonImportsCheck = [ "rchitect" ];
51
52 meta = with lib; {
53 description = "Interoperate R with Python";
54 homepage = "https://github.com/randy3k/rchitect";
55 changelog = "https://github.com/randy3k/rchitect/blob/v${version}/CHANGELOG.md";
56 license = licenses.mit;
57 maintainers = with maintainers; [ savyajha ];
58 };
59}