From 2de81ee78fb62b257c5dff135964fc8b08504e5c Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sun, 3 Mar 2019 13:21:22 +0100 Subject: [PATCH 1/3] sage: patch for pip 19 pip 19 introduced a deprecation warning for python 2.7. Since sage internally uses pip to query for installed packages, this deprecation warning will show up at unexpected times. That is ugly and messes with the testsuite. Upstream: https://trac.sagemath.org/ticket/27405 --- .../sage/patches/ignore-pip-deprecation.patch | 22 +++++++++++++++++++ .../science/math/sage/sage-src.nix | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch diff --git a/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch new file mode 100644 index 00000000000..95b377dc955 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch @@ -0,0 +1,22 @@ +diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py +index 689e5a23b9..4e16fe3a8d 100644 +--- a/src/sage/misc/package.py ++++ b/src/sage/misc/package.py +@@ -142,9 +142,14 @@ def pip_installed_packages(): + sage: d['beautifulsoup'] # optional - beautifulsoup + u'...' + """ +- proc = subprocess.Popen(["pip", "list", "--no-index", "--format", "json"], stdout=subprocess.PIPE) +- stdout = proc.communicate()[0].decode() +- return {package['name'].lower():package['version'] for package in json.loads(stdout)} ++ with open(os.devnull, 'w') as devnull: ++ proc = subprocess.Popen( ++ ["pip", "list", "--no-index", "--format", "json"], ++ stdout=subprocess.PIPE, ++ stderr=devnull, ++ ) ++ stdout = proc.communicate()[0].decode() ++ return {package['name'].lower():package['version'] for package in json.loads(stdout)} + + def list_packages(*pkg_types, **opts): + r""" diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 7302b5e337d..83459021687 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -112,6 +112,9 @@ stdenv.mkDerivation rec { url = "https://git.sagemath.org/sage.git/patch?id=a05b6b038e1571ab15464e98f76d1927c0c3fd12"; sha256 = "05yq97pq84xi60wb1p9skrad5h5x770gq98ll4frr7hvvmlwsf58"; }) + + # https://trac.sagemath.org/ticket/27405 + ./patches/ignore-pip-deprecation.patch ]; patches = nixPatches ++ packageUpgradePatches; From c6e4e1dbdffd5d2068ff182608e29a9055ab4188 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sun, 3 Mar 2019 13:24:43 +0100 Subject: [PATCH 2/3] python.pkgs.rpy2: fix strictDeps fallout See https://github.com/NixOS/nixpkgs/pull/54182 and https://github.com/NixOS/nixpkgs/pull/55757. --- pkgs/development/python-modules/rpy2/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/rpy2/default.nix b/pkgs/development/python-modules/rpy2/default.nix index 7ff5b0343ea..1b4ab4d40db 100644 --- a/pkgs/development/python-modules/rpy2/default.nix +++ b/pkgs/development/python-modules/rpy2/default.nix @@ -58,6 +58,10 @@ buildPythonPackage rec { tidyr ]) ++ extraRPackages ++ rWrapper.recommendedPackages; + nativeBuildInputs = [ + R # needed at setup time to detect R_HOME (alternatively set R_HOME explicitly) + ]; + 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. From 9e3754786bd674ab1bcf80c25bd3a08120f6f1d6 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sun, 3 Mar 2019 13:25:40 +0100 Subject: [PATCH 3/3] sage: fix strictDeps fallout See https://github.com/NixOS/nixpkgs/pull/54182 and https://github.com/NixOS/nixpkgs/pull/55757. --- pkgs/applications/science/math/sage/sagelib.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index 814eef9560e..d7f9cb9ee32 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -65,11 +65,13 @@ buildPythonPackage rec { perl jupyter_core pkg-config + pip # needed to query installed packages ]; buildInputs = [ gd readline + iml ]; propagatedBuildInputs = [