summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/rpy2-robjects/default.nix
blob: b2bd03fc682d6313c9f81b7f4e32624ceacd3334 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  stdenv,
  lib,
  buildPythonPackage,
  fetchurl,
  fetchpatch2,
  isPyPy,
  R,
  rpy2-rinterface,
  ipython,
  jinja2,
  numpy,
  pandas,
  tzlocal,
  pytestCheckHook,
}:

buildPythonPackage rec {
  version = "3.6.3";
  pyproject = true;
  pname = "rpy2-robjects";

  disabled = isPyPy;
  src = fetchurl {
    url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${
      builtins.replaceStrings [ "-" ] [ "_" ] pname
    }-${version}.tar.gz";
    hash = "sha256-cxqhpJBcSyXAVk1yy/2F+SMBAvmJ56IlFYhekdTfPUA=";
  };

  patches = [
    # https://github.com/rpy2/rpy2/pull/1171#issuecomment-3263994962
    (fetchpatch2 {
      url = "https://github.com/rpy2/rpy2/commit/524546eef9b8f7f3d61aeb76d7e7fa7beeabd2d2.patch?full_index=1";
      hash = "sha256-aR44E8wIBlD7UpQKm7B+aMn2p3FQ8dwBwLwkibIpcuM=";
      relative = "rpy2-robjects";
      revert = true;
    })
  ];

  nativeBuildInputs = [
    R # needed at setup time to detect R_HOME (alternatively set R_HOME explicitly)
  ];

  propagatedBuildInputs = [
    ipython
    jinja2
    numpy
    pandas
    rpy2-rinterface
    tzlocal
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    homepage = "https://rpy2.github.io/";
    description = "Python interface to R";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ joelmo ];
  };
}