1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchurl,
6 fetchpatch2,
7 isPyPy,
8 R,
9 rpy2-rinterface,
10 ipython,
11 jinja2,
12 numpy,
13 pandas,
14 tzlocal,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 version = "3.6.2";
20 format = "pyproject";
21 pname = "rpy2-robjects";
22
23 disabled = isPyPy;
24 src = fetchurl {
25 url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${
26 builtins.replaceStrings [ "-" ] [ "_" ] pname
27 }-${version}.tar.gz";
28 hash = "sha256-rJGvMtXE2iNrBaPNaNr7JM2PWogPAHhim48r8CUFQjs=";
29 };
30
31 patches = [
32 # https://github.com/rpy2/rpy2/pull/1171#issuecomment-3263994962
33 (fetchpatch2 {
34 url = "https://github.com/rpy2/rpy2/commit/524546eef9b8f7f3d61aeb76d7e7fa7beeabd2d2.patch?full_index=1";
35 hash = "sha256-aR44E8wIBlD7UpQKm7B+aMn2p3FQ8dwBwLwkibIpcuM=";
36 relative = "rpy2-robjects";
37 revert = true;
38 })
39 ];
40
41 nativeBuildInputs = [
42 R # needed at setup time to detect R_HOME (alternatively set R_HOME explicitly)
43 ];
44
45 propagatedBuildInputs = [
46 ipython
47 jinja2
48 numpy
49 pandas
50 rpy2-rinterface
51 tzlocal
52 ];
53
54 nativeCheckInputs = [ pytestCheckHook ];
55
56 meta = {
57 homepage = "https://rpy2.github.io/";
58 description = "Python interface to R";
59 license = lib.licenses.gpl2Plus;
60 platforms = lib.platforms.unix;
61 maintainers = with lib.maintainers; [ joelmo ];
62 };
63}