mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-03 04:37:06 -08:00
Package-Manager: portage-2.2.25 Signed-off-by: Justin Lecher <jlec@gentoo.org>
48 lines
1.5 KiB
Diff
48 lines
1.5 KiB
Diff
From c650bc8a2b901a9e8d0c09f11f2482cfa6a1daee Mon Sep 17 00:00:00 2001
|
|
From: Daniel Milde <daniel@milde.cz>
|
|
Date: Sun, 8 Nov 2015 21:15:08 +0100
|
|
Subject: [PATCH] installation of jupyter hook to given destination
|
|
|
|
---
|
|
setup.py | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
index 2996546..83984ba 100755
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -19,7 +19,7 @@
|
|
HAVE_SETUPTOOLS = False
|
|
|
|
try:
|
|
- from jupyter_client.kernelspec import install_kernel_spec
|
|
+ from jupyter_client.kernelspec import KernelSpecManager
|
|
HAVE_JUPYTER = True
|
|
except ImportError:
|
|
HAVE_JUPYTER = False
|
|
@@ -49,7 +49,7 @@ def build_tables():
|
|
sys.path.pop(0)
|
|
|
|
|
|
-def install_jupyter_hook():
|
|
+def install_jupyter_hook(root=None):
|
|
if not HAVE_JUPYTER:
|
|
print('Could not install Jupyter kernel spec, please install Jupyter/IPython.')
|
|
return
|
|
@@ -73,13 +73,13 @@ def install_jupyter_hook():
|
|
with open(os.path.join(d, 'kernel.json'), 'w') as f:
|
|
json.dump(spec, f, sort_keys=True)
|
|
print('Installing Jupyter kernel spec...')
|
|
- install_kernel_spec(d, 'xonsh', user=('--user' in sys.argv), replace=True)
|
|
+ KernelSpecManager().install_kernel_spec(d, 'xonsh', user=('--user' in sys.argv), replace=True, prefix=root)
|
|
|
|
class xinstall(install):
|
|
def run(self):
|
|
clean_tables()
|
|
build_tables()
|
|
- install_jupyter_hook()
|
|
+ install_jupyter_hook(self.root if self.root else None)
|
|
install.run(self)
|
|
|
|
|