From def736708ef2dc2efe800e0205901da23c2b6eb0 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Sun, 7 Sep 2025 17:48:16 -0300 Subject: [PATCH] python313Packages.rpy2: 3.6.2 -> 3.6.3, unbreak --- .../python-modules/rpy2/default.nix | 86 ++----------------- .../rpy2/rpy2-3.x-r-libs-site.patch | 21 ----- pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 10 insertions(+), 99 deletions(-) delete mode 100644 pkgs/development/python-modules/rpy2/rpy2-3.x-r-libs-site.patch diff --git a/pkgs/development/python-modules/rpy2/default.nix b/pkgs/development/python-modules/rpy2/default.nix index 0f6b273fa3ab..664b81ea843b 100644 --- a/pkgs/development/python-modules/rpy2/default.nix +++ b/pkgs/development/python-modules/rpy2/default.nix @@ -4,99 +4,31 @@ buildPythonPackage, fetchPypi, isPyPy, - R, - libdeflate, - rWrapper, - rPackages, - pcre, - xz, - bzip2, - zlib, - zstd, - icu, - ipython, - jinja2, - pytz, - pandas, - numpy, - cffi, - tzlocal, - simplegeneric, + rpy2-rinterface, + rpy2-robjects, pytestCheckHook, - extraRPackages ? [ ], }: buildPythonPackage rec { - version = "3.6.2"; - format = "setuptools"; + version = "3.6.3"; + format = "pyproject"; pname = "rpy2"; disabled = isPyPy; src = fetchPypi { inherit version pname; - hash = "sha256-F06ld2qR0Ds13VYRiJlg4PVFHp0KvqSr/IwL5qhTd9A="; + hash = "sha256-lCYYoSUhljAG0i6IqqTUgakjghwDoXQsmb7uci6w/Fo="; }; - patches = [ - # R_LIBS_SITE is used by the nix r package to point to the installed R libraries. - # This patch sets R_LIBS_SITE when rpy2 is imported. - ./rpy2-3.x-r-libs-site.patch - ]; - - postPatch = '' - substituteInPlace 'rpy2/rinterface_lib/embedded.py' --replace '@NIX_R_LIBS_SITE@' "$R_LIBS_SITE" - substituteInPlace 'requirements.txt' --replace 'pytest' "" - ''; - - buildInputs = [ - pcre - xz - bzip2 - zlib - zstd - icu - libdeflate - ] - ++ (with rPackages; [ - # packages expected by the test framework - ggplot2 - dplyr - RSQLite - broom - DBI - dbplyr - hexbin - lazyeval - lme4 - tidyr - ]) - ++ extraRPackages - ++ rWrapper.recommendedPackages; - - nativeBuildInputs = [ - R # needed at setup time to detect R_HOME (alternatively set R_HOME explicitly) - ]; - propagatedBuildInputs = [ - ipython - jinja2 - pytz - pandas - numpy - cffi - tzlocal - simplegeneric + rpy2-rinterface + rpy2-robjects ]; - # https://github.com/rpy2/rpy2/issues/1111 - disabledTests = [ - "test_parse_incomplete_error" - "test_parse_error" - "test_parse_error_when_evaluting" + pythonImportsCheck = [ + "rpy2" ]; - nativeCheckInputs = [ pytestCheckHook ]; - meta = { homepage = "https://rpy2.github.io/"; description = "Python interface to R"; diff --git a/pkgs/development/python-modules/rpy2/rpy2-3.x-r-libs-site.patch b/pkgs/development/python-modules/rpy2/rpy2-3.x-r-libs-site.patch deleted file mode 100644 index 2617472096d4..000000000000 --- a/pkgs/development/python-modules/rpy2/rpy2-3.x-r-libs-site.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/rpy2/rinterface_lib/embedded.py b/rpy2/rinterface_lib/embedded.py -index ccd3a315..51fb5da4 100644 ---- a/rpy2/rinterface_lib/embedded.py -+++ b/rpy2/rinterface_lib/embedded.py -@@ -276,6 +276,16 @@ def _initr( - os.environ.get('LD_LIBRARY_PATH', '')) - ) - ) -+ -+ # path to libraries -+ existing = os.environ.get('R_LIBS_SITE') -+ if existing is not None: -+ prefix = existing + ':' -+ else: -+ prefix = '' -+ additional = '@NIX_R_LIBS_SITE@' -+ os.environ['R_LIBS_SITE'] = prefix + additional -+ - options_c = [ffi.new('char[]', o.encode('ASCII')) for o in _options] - n_options = len(options_c) - n_options_c = ffi.cast('int', n_options) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 066010586b93..5a851cf157ea 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16111,7 +16111,7 @@ self: super: with self; { rpmfluff = callPackage ../development/python-modules/rpmfluff { }; - rpy2 = callPackage ../development/python-modules/rpy2 { inherit (pkgs) zstd; }; + rpy2 = callPackage ../development/python-modules/rpy2 { }; rpy2-rinterface = callPackage ../development/python-modules/rpy2-rinterface { inherit (pkgs) zstd;