1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages jupyter)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix build-system cmake)
25 #:use-module (guix build-system python)
26 #:use-module (gnu packages check)
27 #:use-module (gnu packages cpp)
28 #:use-module (gnu packages linux)
29 #:use-module (gnu packages networking)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages python-xyz)
33 #:use-module (gnu packages serialization)
34 #:use-module (gnu packages time)
35 #:use-module (gnu packages tls))
37 (define-public python-jupyter-protocol
39 (name "python-jupyter-protocol")
43 (uri (pypi-uri "jupyter_protocol" version))
46 "1bk3as5yw9y5nmq6l15nr46aby34phmvsx9kxgqnm5pd5q2b5h57"))))
47 (build-system python-build-system)
49 `(("python-dateutil" ,python-dateutil)
50 ("python-jupyter-core" ,python-jupyter-core)
51 ("python-pyzmq" ,python-pyzmq)
52 ("python-traitlets" ,python-traitlets)))
54 `(("python-ipykernel" ,python-ipykernel)
55 ("python-ipython" ,python-ipython)
56 ("python-mock" ,python-mock)
57 ("python-pytest" ,python-pytest)))
58 (home-page "https://jupyter.org")
59 (synopsis "Jupyter protocol implementation")
61 "This Python library is an experimental implementation of the
62 @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
63 protocol} to be used by both clients and kernels.")
64 (license license:bsd-3)
65 (properties '((upstream-name . "jupyter_protocol")))))
67 (define-public python-jupyter-kernel-mgmt
69 (name "python-jupyter-kernel-mgmt")
73 (uri (pypi-uri "jupyter_kernel_mgmt" version))
76 "0i7a78dn89ca8h0a42giyxwcmk6y4wrdr7q8h2ax9vybb84c795q"))))
77 (build-system python-build-system)
79 `(("python-dateutil" ,python-dateutil)
80 ("python-entrypoints" ,python-entrypoints)
81 ("python-jupyter-core" ,python-jupyter-core)
82 ("python-jupyter-protocol" ,python-jupyter-protocol)
83 ("python-pyzmq" ,python-pyzmq)
84 ("python-traitlets" ,python-traitlets)))
86 `(("python-ipykernel" ,python-ipykernel)
87 ("python-ipython" ,python-ipython)
88 ("python-mock" ,python-mock)
89 ("python-pytest" ,python-pytest)))
90 (home-page "https://jupyter.org")
91 (synopsis "Discover, launch, and communicate with Jupyter kernels")
93 "This package is an experimental refactoring of the machinery for
94 launching and using Jupyter kernels.")
95 (license license:bsd-3)
96 (properties '((upstream-name . "jupyter_kernel_mgmt")))))
98 (define-public python-jupyter-kernel-test
100 (name "python-jupyter-kernel-test")
102 (home-page "https://github.com/jupyter/jupyter_kernel_test")
104 ;; PyPI has a ".whl" file but not a proper source release.
105 ;; Thus, fetch code from Git.
107 (uri (git-reference (url home-page) (commit version)))
108 (file-name (git-file-name name version))
111 "00iy74i4i8is6axb9vlsm0b9wxkvyyxnbl8r0i4gaj3xd788jm83"))))
112 (build-system python-build-system)
114 ;; The repo doesn't contain a "setup.py" file so install files manually.
115 '(#:phases (modify-phases %standard-phases
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 (let* ((out (assoc-ref outputs "out"))
121 (version (python-version (assoc-ref inputs "python")))
122 (pydir (string-append out "/lib/python"
123 version "/site-packages/"
124 "jupyter_kernel_test")))
125 (for-each (lambda (file)
126 (install-file file pydir))
127 (find-files "jupyter_kernel_test"
131 `(("python-jupyter-kernel-mgmt" ,python-jupyter-kernel-mgmt)
132 ("python-jupyter-protocol" ,python-jupyter-protocol)
133 ("python-jsonschema" ,python-jsonschema)))
134 (synopsis "Test Jupyter kernels")
136 "@code{jupyter_kernel_test} is a tool for testing Jupyter kernels. It
137 tests kernels for successful code execution and conformance with the
138 @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
139 Messaging Protocol}.")
140 (license license:bsd-3)))
149 (url "https://github.com/QuantStack/xeus.git")
153 "1m1b6z1538r7mv2ggn7bdbd9570ja7cadplq64zl8rgl2c8vdi2a"))
154 (file-name (git-file-name name version))))
155 (build-system cmake-build-system)
157 '(#:configure-flags '("-DBUILD_STATIC_LIBS=OFF"
158 "-DDISABLE_ARCH_NATIVE=ON" ;no '-march=native'
159 "-DBUILD_TESTING=ON")))
161 `(("pkg-config" ,pkg-config)
163 ;; The following inputs are used by the test suite.
164 ("googletest" ,googletest)
165 ("python-pytest" ,python-pytest)
167 ("python-jupyter-kernel-test" ,python-jupyter-kernel-test)
168 ("python-jupyter-client" ,python-jupyter-client)))
171 ("nlohmann-json-cpp" ,nlohmann-json-cpp)
175 ("util-linux" ,util-linux))) ;libuuid
176 (home-page "https://quantstack.net/xeus")
177 (synopsis "C++ implementation of the Jupyter Kernel protocol")
179 "@code{xeus} is a library meant to facilitate the implementation of
180 kernels for Jupyter. It takes the burden of implementing the Jupyter Kernel
181 protocol so developers can focus on implementing the interpreter part of the
184 Several Jupyter kernels are built upon @code{xeus}, such as @code{xeus-cling},
185 a kernel for the C++ programming language, and @code{xeus-python}, an
186 alternative Python kernel for Jupyter.")
187 (license license:bsd-3)))