Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #57253 from timokau/sage-python-upgrade-fixes-19.03
Browse files Browse the repository at this point in the history
[19.03] Sage python upgrade fixes
  • Loading branch information
timokau committed Mar 10, 2019
2 parents 52e59ba + 64c1b93 commit 72ad05b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"""
3 changes: 3 additions & 0 deletions pkgs/applications/science/math/sage/sage-src.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/applications/science/math/sage/sagelib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ buildPythonPackage rec {
perl
jupyter_core
pkg-config
pip # needed to query installed packages
];

buildInputs = [
gd
readline
iml
];

propagatedBuildInputs = [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/rpy2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 72ad05b

Please sign in to comment.