Commit | Line | Data |
---|---|---|
2cde4a96 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
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. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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/>. | |
18 | ||
19 | (define-module (gnu packages jupyter) | |
20 | #:use-module ((guix licenses) #:prefix license:) | |
21 | #:use-module (guix packages) | |
22 | #:use-module (guix download) | |
a52d8cc6 | 23 | #:use-module (guix git-download) |
4bb7d14b | 24 | #:use-module (guix build-system cmake) |
2cde4a96 LC |
25 | #:use-module (guix build-system python) |
26 | #:use-module (gnu packages check) | |
4bb7d14b LC |
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) | |
2cde4a96 LC |
31 | #:use-module (gnu packages python) |
32 | #:use-module (gnu packages python-xyz) | |
4bb7d14b LC |
33 | #:use-module (gnu packages serialization) |
34 | #:use-module (gnu packages time) | |
35 | #:use-module (gnu packages tls)) | |
2cde4a96 LC |
36 | |
37 | (define-public python-jupyter-protocol | |
38 | (package | |
39 | (name "python-jupyter-protocol") | |
40 | (version "0.1.1") | |
41 | (source (origin | |
42 | (method url-fetch) | |
43 | (uri (pypi-uri "jupyter_protocol" version)) | |
44 | (sha256 | |
45 | (base32 | |
46 | "1bk3as5yw9y5nmq6l15nr46aby34phmvsx9kxgqnm5pd5q2b5h57")))) | |
47 | (build-system python-build-system) | |
48 | (propagated-inputs | |
49 | `(("python-dateutil" ,python-dateutil) | |
50 | ("python-jupyter-core" ,python-jupyter-core) | |
51 | ("python-pyzmq" ,python-pyzmq) | |
52 | ("python-traitlets" ,python-traitlets))) | |
53 | (native-inputs | |
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") | |
60 | (description | |
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"))))) | |
2835fb07 LC |
66 | |
67 | (define-public python-jupyter-kernel-mgmt | |
68 | (package | |
69 | (name "python-jupyter-kernel-mgmt") | |
70 | (version "0.4.0") | |
71 | (source (origin | |
72 | (method url-fetch) | |
73 | (uri (pypi-uri "jupyter_kernel_mgmt" version)) | |
74 | (sha256 | |
75 | (base32 | |
76 | "0i7a78dn89ca8h0a42giyxwcmk6y4wrdr7q8h2ax9vybb84c795q")))) | |
77 | (build-system python-build-system) | |
78 | (propagated-inputs | |
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))) | |
85 | (native-inputs | |
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") | |
92 | (description | |
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"))))) | |
a52d8cc6 LC |
97 | |
98 | (define-public python-jupyter-kernel-test | |
99 | (package | |
100 | (name "python-jupyter-kernel-test") | |
101 | (version "0.3") | |
102 | (home-page "https://github.com/jupyter/jupyter_kernel_test") | |
103 | (source (origin | |
104 | ;; PyPI has a ".whl" file but not a proper source release. | |
105 | ;; Thus, fetch code from Git. | |
106 | (method git-fetch) | |
107 | (uri (git-reference (url home-page) (commit version))) | |
108 | (file-name (git-file-name name version)) | |
109 | (sha256 | |
110 | (base32 | |
111 | "00iy74i4i8is6axb9vlsm0b9wxkvyyxnbl8r0i4gaj3xd788jm83")))) | |
112 | (build-system python-build-system) | |
113 | (arguments | |
114 | ;; The repo doesn't contain a "setup.py" file so install files manually. | |
115 | '(#:phases (modify-phases %standard-phases | |
116 | (delete 'build) | |
117 | (delete 'check) | |
118 | (replace 'install | |
119 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
120 | (let* ((out (assoc-ref outputs "out")) | |
9f294736 | 121 | (version (python-version (assoc-ref inputs "python"))) |
a52d8cc6 LC |
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" | |
128 | "\\.py$")) | |
129 | #t)))))) | |
130 | (propagated-inputs | |
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") | |
135 | (description | |
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))) | |
4bb7d14b LC |
141 | |
142 | (define-public xeus | |
143 | (package | |
144 | (name "xeus") | |
145 | (version "0.23.2") | |
146 | (source (origin | |
147 | (method git-fetch) | |
148 | (uri (git-reference | |
149 | (url "https://github.com/QuantStack/xeus.git") | |
150 | (commit version))) | |
151 | (sha256 | |
152 | (base32 | |
153 | "1m1b6z1538r7mv2ggn7bdbd9570ja7cadplq64zl8rgl2c8vdi2a")) | |
154 | (file-name (git-file-name name version)))) | |
155 | (build-system cmake-build-system) | |
156 | (arguments | |
157 | '(#:configure-flags '("-DBUILD_STATIC_LIBS=OFF" | |
158 | "-DDISABLE_ARCH_NATIVE=ON" ;no '-march=native' | |
159 | "-DBUILD_TESTING=ON"))) | |
160 | (native-inputs | |
161 | `(("pkg-config" ,pkg-config) | |
162 | ||
163 | ;; The following inputs are used by the test suite. | |
164 | ("googletest" ,googletest) | |
165 | ("python-pytest" ,python-pytest) | |
166 | ("python" ,python-3) | |
167 | ("python-jupyter-kernel-test" ,python-jupyter-kernel-test) | |
168 | ("python-jupyter-client" ,python-jupyter-client))) | |
169 | (inputs | |
170 | `(("xtl" ,xtl) | |
171 | ("nlohmann-json-cpp" ,nlohmann-json-cpp) | |
172 | ("cppzmq" ,cppzmq) | |
173 | ("zeromq" ,zeromq) | |
174 | ("openssl" ,openssl) | |
175 | ("util-linux" ,util-linux))) ;libuuid | |
176 | (home-page "https://quantstack.net/xeus") | |
177 | (synopsis "C++ implementation of the Jupyter Kernel protocol") | |
178 | (description | |
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 | |
182 | kernel. | |
183 | ||
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))) |