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