This repository has been archived by the owner on Apr 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57253 from timokau/sage-python-upgrade-fixes-19.03
[19.03] Sage python upgrade fixes
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters