diff --git a/pkgs/development/python-modules/rpy2-robjects/default.nix b/pkgs/development/python-modules/rpy2-robjects/default.nix new file mode 100644 index 000000000000..566cf7581068 --- /dev/null +++ b/pkgs/development/python-modules/rpy2-robjects/default.nix @@ -0,0 +1,63 @@ +{ + stdenv, + lib, + buildPythonPackage, + fetchurl, + fetchpatch2, + isPyPy, + R, + rpy2-rinterface, + ipython, + jinja2, + numpy, + pandas, + tzlocal, + pytestCheckHook, +}: + +buildPythonPackage rec { + version = "3.6.2"; + format = "pyproject"; + pname = "rpy2-robjects"; + + disabled = isPyPy; + src = fetchurl { + url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${ + builtins.replaceStrings [ "-" ] [ "_" ] pname + }-${version}.tar.gz"; + hash = "sha256-rJGvMtXE2iNrBaPNaNr7JM2PWogPAHhim48r8CUFQjs="; + }; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bcdb188bfe9e..066010586b93 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16117,6 +16117,8 @@ self: super: with self; { inherit (pkgs) zstd; }; + rpy2-robjects = callPackage ../development/python-modules/rpy2-robjects { }; + rpyc = callPackage ../development/python-modules/rpyc { }; rq = callPackage ../development/python-modules/rq { };