Skip to content

Commit 5869795

Browse files
committed
gnu: Add package python-jupyterlab
* gnu/packages/python-xyz.scm (python-jupyterlab): New variable.
1 parent 5752a02 commit 5869795

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff '--exclude=*.swp' -Naur jupyterlab-1.2.6.orig/jupyterlab/commands.py jupyterlab-1.2.6/jupyterlab/commands.py
2+
--- jupyterlab-1.2.6.orig/jupyterlab/commands.py 2020-01-24 17:25:16.238353500 +0100
3+
+++ jupyterlab-1.2.6/jupyterlab/commands.py 2020-01-31 12:36:10.497375982 +0100
4+
@@ -1100,7 +1100,7 @@
5+
'webpack.prod.minimize.config.js',
6+
'.yarnrc', 'yarn.js']:
7+
target = pjoin(staging, fname)
8+
- shutil.copy(pjoin(HERE, 'staging', fname), target)
9+
+ shutil.copyfile(pjoin(HERE, 'staging', fname), target)
10+
11+
# Ensure a clean templates directory
12+
templates = pjoin(staging, 'templates')
13+
@@ -1108,7 +1108,10 @@
14+
_rmtree(templates, self.logger)
15+
16+
try:
17+
- shutil.copytree(pjoin(HERE, 'staging', 'templates'), templates)
18+
+ shutil.copytree(pjoin(HERE, 'staging', 'templates'), templates,
19+
+ copy_function=shutil.copyfile)
20+
+ # cannot replace or disable copytree’s call to .copystat
21+
+ os.chmod (templates, 0o755)
22+
except shutil.Error as error:
23+
# `copytree` throws an error if copying to + from NFS even though
24+
# the copy is successful (see https://bugs.python.org/issue24564
25+
@@ -1178,7 +1181,7 @@
26+
with open(lock_path, 'w', encoding='utf-8') as f:
27+
f.write(template)
28+
elif not osp.exists(lock_path):
29+
- shutil.copy(lock_template, lock_path)
30+
+ shutil.copyfile(lock_template, lock_path)
31+
32+
def _get_package_template(self, silent=False):
33+
"""Get the template the for staging package.json file.

gnu/packages/python-xyz.scm

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
#:use-module (gnu packages multiprecision)
126126
#:use-module (gnu packages networking)
127127
#:use-module (gnu packages ncurses)
128+
#:use-module (gnu packages node)
128129
#:use-module (gnu packages openstack)
129130
#:use-module (gnu packages pcre)
130131
#:use-module (gnu packages perl)
@@ -17552,3 +17553,57 @@ dumping of JSON5 data structures.")
1755217553
(description "A set of server components for JupyterLab and JupyterLab like
1755317554
applications")
1755417555
(license license:bsd-3)))
17556+
17557+
(define-public python-jupyterlab
17558+
(package
17559+
(name "python-jupyterlab")
17560+
(version "1.2.6")
17561+
(source
17562+
(origin
17563+
(method url-fetch)
17564+
(uri (pypi-uri "jupyterlab" version))
17565+
(sha256
17566+
(base32
17567+
"0mc3nrj7fc5q2ajr09m261j386jsp8qjljg8anghlh8czc9ln4s2"))
17568+
(patches (search-patches "python-jupyterlab-copy-nometa.patch"))))
17569+
(build-system python-build-system)
17570+
(propagated-inputs
17571+
`(("python-jinja2" ,python-jinja2)
17572+
("python-jupyterlab-server"
17573+
,python-jupyterlab-server)
17574+
("python-notebook" ,python-notebook)
17575+
("python-tornado" ,python-tornado)
17576+
("node" ,node)))
17577+
(native-inputs
17578+
`(("python-pytest" ,python-pytest)
17579+
("python-pytest-check-links"
17580+
,python-pytest-check-links)
17581+
("python-requests" ,python-requests)
17582+
("python-ipykernel" ,python-ipykernel)))
17583+
(arguments
17584+
;; testing requires npm, so disabled for now
17585+
'(#:tests? #f
17586+
#:phases
17587+
(modify-phases %standard-phases
17588+
(add-after 'unpack 'patch-syspath
17589+
(lambda* (#:key outputs inputs configure-flags #:allow-other-keys)
17590+
(let* ((out (assoc-ref outputs "out")))
17591+
(substitute* "jupyterlab/commands.py"
17592+
;; sys.prefix defaults to Python’s prefix in the store, not
17593+
;; jupyterlab’s. Fix that.
17594+
(("sys\\.prefix")
17595+
(string-append "'" out "'"))))
17596+
#t))
17597+
;; 'build does not respect configure-flags
17598+
(replace 'build
17599+
(lambda _
17600+
(invoke "python" "setup.py" "build" "--skip-npm"))))
17601+
#:configure-flags (list "--skip-npm")))
17602+
(home-page "https://jupyter.org")
17603+
(synopsis
17604+
"The JupyterLab notebook server extension")
17605+
(description
17606+
"An extensible environment for interactive and reproducible computing,
17607+
based on the Jupyter Notebook and Architecture.")
17608+
(license license:bsd-3)))
17609+

0 commit comments

Comments
 (0)