Skip to content

Commit c50fc3e

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

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
@@ -126,6 +126,7 @@
126126
#:use-module (gnu packages multiprecision)
127127
#:use-module (gnu packages networking)
128128
#:use-module (gnu packages ncurses)
129+
#:use-module (gnu packages node)
129130
#:use-module (gnu packages openstack)
130131
#:use-module (gnu packages pcre)
131132
#:use-module (gnu packages perl)
@@ -17656,3 +17657,57 @@ dumping of JSON5 data structures.")
1765617657
(description "A set of server components for JupyterLab and JupyterLab like
1765717658
applications")
1765817659
(license license:bsd-3)))
17660+
17661+
(define-public python-jupyterlab
17662+
(package
17663+
(name "python-jupyterlab")
17664+
(version "1.2.6")
17665+
(source
17666+
(origin
17667+
(method url-fetch)
17668+
(uri (pypi-uri "jupyterlab" version))
17669+
(sha256
17670+
(base32
17671+
"0mc3nrj7fc5q2ajr09m261j386jsp8qjljg8anghlh8czc9ln4s2"))
17672+
(patches (search-patches "python-jupyterlab-copy-nometa.patch"))))
17673+
(build-system python-build-system)
17674+
(propagated-inputs
17675+
`(("python-jinja2" ,python-jinja2)
17676+
("python-jupyterlab-server"
17677+
,python-jupyterlab-server)
17678+
("python-notebook" ,python-notebook)
17679+
("python-tornado" ,python-tornado)
17680+
("node" ,node)))
17681+
(native-inputs
17682+
`(("python-pytest" ,python-pytest)
17683+
("python-pytest-check-links"
17684+
,python-pytest-check-links)
17685+
("python-requests" ,python-requests)
17686+
("python-ipykernel" ,python-ipykernel)))
17687+
(arguments
17688+
;; testing requires npm, so disabled for now
17689+
'(#:tests? #f
17690+
#:phases
17691+
(modify-phases %standard-phases
17692+
(add-after 'unpack 'patch-syspath
17693+
(lambda* (#:key outputs inputs configure-flags #:allow-other-keys)
17694+
(let* ((out (assoc-ref outputs "out")))
17695+
(substitute* "jupyterlab/commands.py"
17696+
;; sys.prefix defaults to Python’s prefix in the store, not
17697+
;; jupyterlab’s. Fix that.
17698+
(("sys\\.prefix")
17699+
(string-append "'" out "'"))))
17700+
#t))
17701+
;; 'build does not respect configure-flags
17702+
(replace 'build
17703+
(lambda _
17704+
(invoke "python" "setup.py" "build" "--skip-npm"))))
17705+
#:configure-flags (list "--skip-npm")))
17706+
(home-page "https://jupyter.org")
17707+
(synopsis
17708+
"The JupyterLab notebook server extension")
17709+
(description
17710+
"An extensible environment for interactive and reproducible computing,
17711+
based on the Jupyter Notebook and Architecture.")
17712+
(license license:bsd-3)))
17713+

0 commit comments

Comments
 (0)