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