1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages jupyter)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages cpp)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages networking)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages python-build)
34 #:use-module (gnu packages python-check)
35 #:use-module (gnu packages python-xyz)
36 #:use-module (gnu packages time)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages xml))
40 (define-public python-jupyter-protocol
42 (name "python-jupyter-protocol")
46 (uri (pypi-uri "jupyter_protocol" version))
49 "1bk3as5yw9y5nmq6l15nr46aby34phmvsx9kxgqnm5pd5q2b5h57"))))
50 (build-system python-build-system)
52 `(("python-dateutil" ,python-dateutil)
53 ("python-jupyter-core" ,python-jupyter-core)
54 ("python-pyzmq" ,python-pyzmq)
55 ("python-traitlets" ,python-traitlets)))
57 `(("python-ipykernel" ,python-ipykernel)
58 ("python-ipython" ,python-ipython)
59 ("python-mock" ,python-mock)
60 ("python-pytest" ,python-pytest)))
61 (home-page "https://jupyter.org")
62 (synopsis "Jupyter protocol implementation")
64 "This Python library is an experimental implementation of the
65 @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
66 protocol} to be used by both clients and kernels.")
67 (license license:bsd-3)
68 (properties '((upstream-name . "jupyter_protocol")))))
70 (define-public python-jupyter-kernel-mgmt
72 (name "python-jupyter-kernel-mgmt")
76 (uri (pypi-uri "jupyter_kernel_mgmt" version))
79 "0i7a78dn89ca8h0a42giyxwcmk6y4wrdr7q8h2ax9vybb84c795q"))))
80 (build-system python-build-system)
82 `(("python-dateutil" ,python-dateutil)
83 ("python-entrypoints" ,python-entrypoints)
84 ("python-jupyter-core" ,python-jupyter-core)
85 ("python-jupyter-protocol" ,python-jupyter-protocol)
86 ("python-pyzmq" ,python-pyzmq)
87 ("python-traitlets" ,python-traitlets)))
89 `(("python-ipykernel" ,python-ipykernel)
90 ("python-ipython" ,python-ipython)
91 ("python-mock" ,python-mock)
92 ("python-pytest" ,python-pytest)))
93 (home-page "https://jupyter.org")
94 (synopsis "Discover, launch, and communicate with Jupyter kernels")
96 "This package is an experimental refactoring of the machinery for
97 launching and using Jupyter kernels.")
98 (license license:bsd-3)
99 (properties '((upstream-name . "jupyter_kernel_mgmt")))))
101 (define-public python-jupyter-kernel-test
103 (name "python-jupyter-kernel-test")
105 (home-page "https://github.com/jupyter/jupyter_kernel_test")
107 ;; PyPI has a ".whl" file but not a proper source release.
108 ;; Thus, fetch code from Git.
110 (uri (git-reference (url home-page) (commit version)))
111 (file-name (git-file-name name version))
114 "00iy74i4i8is6axb9vlsm0b9wxkvyyxnbl8r0i4gaj3xd788jm83"))))
115 (build-system python-build-system)
117 ;; The repo doesn't contain a "setup.py" file so install files manually.
118 '(#:phases (modify-phases %standard-phases
122 (lambda* (#:key inputs outputs #:allow-other-keys)
123 (let* ((out (assoc-ref outputs "out"))
124 (version (python-version (assoc-ref inputs "python")))
125 (pydir (string-append out "/lib/python"
126 version "/site-packages/"
127 "jupyter_kernel_test")))
128 (for-each (lambda (file)
129 (install-file file pydir))
130 (find-files "jupyter_kernel_test"
134 `(("python-jupyter-kernel-mgmt" ,python-jupyter-kernel-mgmt)
135 ("python-jupyter-protocol" ,python-jupyter-protocol)
136 ("python-jsonschema" ,python-jsonschema)))
137 (synopsis "Test Jupyter kernels")
139 "@code{jupyter_kernel_test} is a tool for testing Jupyter kernels. It
140 tests kernels for successful code execution and conformance with the
141 @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
142 Messaging Protocol}.")
143 (license license:bsd-3)))
152 (url "https://github.com/QuantStack/xeus")
156 "1m1b6z1538r7mv2ggn7bdbd9570ja7cadplq64zl8rgl2c8vdi2a"))
157 (file-name (git-file-name name version))))
158 (build-system cmake-build-system)
160 '(#:configure-flags '("-DBUILD_STATIC_LIBS=OFF"
161 "-DDISABLE_ARCH_NATIVE=ON" ;no '-march=native'
162 "-DBUILD_TESTING=ON")))
164 `(("pkg-config" ,pkg-config)
166 ;; The following inputs are used by the test suite.
167 ("googletest" ,googletest)
168 ("python-pytest" ,python-pytest)
170 ("python-jupyter-kernel-test" ,python-jupyter-kernel-test)
171 ("python-jupyter-client" ,python-jupyter-client)))
174 ("json-modern-cxx" ,json-modern-cxx)
178 ("util-linux" ,util-linux "lib"))) ;libuuid
179 (home-page "https://quantstack.net/xeus")
180 (synopsis "C++ implementation of the Jupyter Kernel protocol")
182 "@code{xeus} is a library meant to facilitate the implementation of
183 kernels for Jupyter. It takes the burden of implementing the Jupyter Kernel
184 protocol so developers can focus on implementing the interpreter part of the
187 Several Jupyter kernels are built upon @code{xeus}, such as @code{xeus-cling},
188 a kernel for the C++ programming language, and @code{xeus-python}, an
189 alternative Python kernel for Jupyter.")
190 (license license:bsd-3)))
192 (define-public python-jupyterlab-pygments
194 (name "python-jupyterlab-pygments")
199 (uri (pypi-uri "jupyterlab_pygments" version))
202 "0ij14mmnc39nmf84i0av6j9glazjic7wzv1qyhr0j5966s3s1kfg"))))
203 (build-system python-build-system)
204 (arguments '(#:tests? #false)) ; there are no tests
206 `(("python-pygments" ,python-pygments)))
207 (home-page "https://jupyter.org")
208 (synopsis "Pygments theme using JupyterLab CSS variables")
210 "This package contains a syntax coloring theme for pygments making use of
211 the JupyterLab CSS variables.")
212 (license license:bsd-3)))
214 (define-public python-jupyter-packaging
216 (name "python-jupyter-packaging")
221 (uri (pypi-uri "jupyter_packaging" version))
224 "0r015c0m713d19asmpimsw6bk2sqv2lpd2nccgjzjdj5h1crg0bg"))))
225 (build-system python-build-system)
227 `(("python-deprecation" ,python-deprecation)
228 ("python-packaging" ,python-packaging)
229 ("python-setuptools" ,python-setuptools)
230 ("python-tomlkit" ,python-tomlkit)
231 ("python-wheel" ,python-wheel)))
233 `(("python-pypa-build" ,python-pypa-build)
234 ("python-coverage" ,python-coverage)
235 ("python-pytest" ,python-pytest)
236 ("python-pytest-cov" ,python-pytest-cov)
237 ("python-pytest-mock" ,python-pytest-mock)))
238 (home-page "https://jupyter.org")
239 (synopsis "Jupyter packaging utilities")
240 (description "This package provides tools to help build and install
241 Jupyter Python packages that require a pre-build step that may include
242 JavaScript build steps.")
243 (license license:bsd-3)))
245 (define-public python-jupyterlab-widgets
247 (name "python-jupyterlab-widgets")
252 (uri (pypi-uri "jupyterlab_widgets" version))
255 "0y7vhhas3qndiypcpcfnhrj9n92v2w4hdc86nn620s9h9nl2j6jw"))))
256 (build-system python-build-system)
258 `(("python-jupyter-packaging" ,python-jupyter-packaging)
259 ("python-setuptools" ,python-setuptools)))
260 (home-page "https://github.com/jupyter-widgets/ipywidgets")
261 (synopsis "Interactive widgets for Jupyter Notebooks")
262 (description "ipywidgets, also known as jupyter-widgets or simply widgets,
263 are interactive HTML widgets for Jupyter notebooks and the IPython kernel.")
264 (license license:bsd-3)))
266 (define-public python-nbclient
268 (name "python-nbclient")
273 (uri (pypi-uri "nbclient" version))
276 "172q4r6mq0lg394di0pc6ipvniy14jg38wkdsj48r366609jf5yv"))))
277 (build-system python-build-system)
278 ;; Tests require a kernel via python-ipykernel, and also tools from
280 (arguments '(#:tests? #false))
282 `(("python-async-generator" ,python-async-generator)
283 ("python-jupyter-client" ,python-jupyter-client)
284 ("python-nbformat" ,python-nbformat)
285 ("python-nest-asyncio" ,python-nest-asyncio)
286 ("python-traitlets" ,python-traitlets)))
288 `(("python-black" ,python-black)
289 ("python-bumpversion" ,python-bumpversion)
290 ("python-check-manifest" ,python-check-manifest)
291 ("python-codecov" ,python-codecov)
292 ("python-coverage" ,python-coverage)
293 ("python-flake8" ,python-flake8)
294 ;; ("python-ipykernel" ,python-ipykernel)
295 ;; ("python-ipython" ,python-ipython)
296 ;; ("python-ipywidgets" ,python-ipywidgets)
297 ("python-mypy" ,python-mypy)
298 ("python-pip" ,python-pip)
299 ("python-pytest" ,python-pytest)
300 ("python-pytest-cov" ,python-pytest-cov)
301 ("python-setuptools" ,python-setuptools)
302 ("python-testpath" ,python-testpath)
303 ("python-tox" ,python-tox)
304 ("python-twine" ,python-twine)
305 ("python-wheel" ,python-wheel)
306 ("python-xmltodict" ,python-xmltodict)))
307 (home-page "https://jupyter.org")
308 (synopsis "Client library for executing notebooks")
310 "This package provides a client library for executing notebooks. Formerly
311 nbconvert's @code{ExecutePreprocessor.}")
312 (license license:bsd-3)))