Commit | Line | Data |
---|---|---|
2cde4a96 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> | |
95456c2f | 3 | ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net> |
2cde4a96 LC |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
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. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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/>. | |
19 | ||
20 | (define-module (gnu packages jupyter) | |
21 | #:use-module ((guix licenses) #:prefix license:) | |
22 | #:use-module (guix packages) | |
23 | #:use-module (guix download) | |
a52d8cc6 | 24 | #:use-module (guix git-download) |
4bb7d14b | 25 | #:use-module (guix build-system cmake) |
2cde4a96 LC |
26 | #:use-module (guix build-system python) |
27 | #:use-module (gnu packages check) | |
4bb7d14b LC |
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) | |
2cde4a96 | 32 | #:use-module (gnu packages python) |
74d2d7a3 RW |
33 | #:use-module (gnu packages python-build) |
34 | #:use-module (gnu packages python-check) | |
2cde4a96 | 35 | #:use-module (gnu packages python-xyz) |
4bb7d14b | 36 | #:use-module (gnu packages time) |
74d2d7a3 RW |
37 | #:use-module (gnu packages tls) |
38 | #:use-module (gnu packages xml)) | |
2cde4a96 LC |
39 | |
40 | (define-public python-jupyter-protocol | |
41 | (package | |
42 | (name "python-jupyter-protocol") | |
43 | (version "0.1.1") | |
44 | (source (origin | |
45 | (method url-fetch) | |
46 | (uri (pypi-uri "jupyter_protocol" version)) | |
47 | (sha256 | |
48 | (base32 | |
49 | "1bk3as5yw9y5nmq6l15nr46aby34phmvsx9kxgqnm5pd5q2b5h57")))) | |
50 | (build-system python-build-system) | |
51 | (propagated-inputs | |
52 | `(("python-dateutil" ,python-dateutil) | |
53 | ("python-jupyter-core" ,python-jupyter-core) | |
54 | ("python-pyzmq" ,python-pyzmq) | |
55 | ("python-traitlets" ,python-traitlets))) | |
56 | (native-inputs | |
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") | |
63 | (description | |
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"))))) | |
2835fb07 LC |
69 | |
70 | (define-public python-jupyter-kernel-mgmt | |
71 | (package | |
72 | (name "python-jupyter-kernel-mgmt") | |
73 | (version "0.4.0") | |
74 | (source (origin | |
75 | (method url-fetch) | |
76 | (uri (pypi-uri "jupyter_kernel_mgmt" version)) | |
77 | (sha256 | |
78 | (base32 | |
79 | "0i7a78dn89ca8h0a42giyxwcmk6y4wrdr7q8h2ax9vybb84c795q")))) | |
80 | (build-system python-build-system) | |
81 | (propagated-inputs | |
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))) | |
88 | (native-inputs | |
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") | |
95 | (description | |
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"))))) | |
a52d8cc6 LC |
100 | |
101 | (define-public python-jupyter-kernel-test | |
102 | (package | |
103 | (name "python-jupyter-kernel-test") | |
104 | (version "0.3") | |
105 | (home-page "https://github.com/jupyter/jupyter_kernel_test") | |
106 | (source (origin | |
107 | ;; PyPI has a ".whl" file but not a proper source release. | |
108 | ;; Thus, fetch code from Git. | |
109 | (method git-fetch) | |
110 | (uri (git-reference (url home-page) (commit version))) | |
111 | (file-name (git-file-name name version)) | |
112 | (sha256 | |
113 | (base32 | |
114 | "00iy74i4i8is6axb9vlsm0b9wxkvyyxnbl8r0i4gaj3xd788jm83")))) | |
115 | (build-system python-build-system) | |
116 | (arguments | |
117 | ;; The repo doesn't contain a "setup.py" file so install files manually. | |
118 | '(#:phases (modify-phases %standard-phases | |
119 | (delete 'build) | |
120 | (delete 'check) | |
121 | (replace 'install | |
122 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
123 | (let* ((out (assoc-ref outputs "out")) | |
9f294736 | 124 | (version (python-version (assoc-ref inputs "python"))) |
a52d8cc6 LC |
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" | |
131 | "\\.py$")) | |
132 | #t)))))) | |
133 | (propagated-inputs | |
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") | |
138 | (description | |
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))) | |
4bb7d14b LC |
144 | |
145 | (define-public xeus | |
146 | (package | |
147 | (name "xeus") | |
148 | (version "0.23.2") | |
149 | (source (origin | |
150 | (method git-fetch) | |
151 | (uri (git-reference | |
b0e7b699 | 152 | (url "https://github.com/QuantStack/xeus") |
4bb7d14b LC |
153 | (commit version))) |
154 | (sha256 | |
155 | (base32 | |
156 | "1m1b6z1538r7mv2ggn7bdbd9570ja7cadplq64zl8rgl2c8vdi2a")) | |
157 | (file-name (git-file-name name version)))) | |
158 | (build-system cmake-build-system) | |
159 | (arguments | |
160 | '(#:configure-flags '("-DBUILD_STATIC_LIBS=OFF" | |
161 | "-DDISABLE_ARCH_NATIVE=ON" ;no '-march=native' | |
162 | "-DBUILD_TESTING=ON"))) | |
163 | (native-inputs | |
164 | `(("pkg-config" ,pkg-config) | |
165 | ||
166 | ;; The following inputs are used by the test suite. | |
167 | ("googletest" ,googletest) | |
168 | ("python-pytest" ,python-pytest) | |
169 | ("python" ,python-3) | |
170 | ("python-jupyter-kernel-test" ,python-jupyter-kernel-test) | |
171 | ("python-jupyter-client" ,python-jupyter-client))) | |
172 | (inputs | |
173 | `(("xtl" ,xtl) | |
936aa052 | 174 | ("json-modern-cxx" ,json-modern-cxx) |
4bb7d14b LC |
175 | ("cppzmq" ,cppzmq) |
176 | ("zeromq" ,zeromq) | |
177 | ("openssl" ,openssl) | |
bb93042c | 178 | ("util-linux" ,util-linux "lib"))) ;libuuid |
4bb7d14b LC |
179 | (home-page "https://quantstack.net/xeus") |
180 | (synopsis "C++ implementation of the Jupyter Kernel protocol") | |
181 | (description | |
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 | |
185 | kernel. | |
186 | ||
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))) | |
95456c2f RW |
191 | |
192 | (define-public python-jupyterlab-pygments | |
193 | (package | |
194 | (name "python-jupyterlab-pygments") | |
195 | (version "0.1.2") | |
196 | (source | |
197 | (origin | |
198 | (method url-fetch) | |
199 | (uri (pypi-uri "jupyterlab_pygments" version)) | |
200 | (sha256 | |
201 | (base32 | |
202 | "0ij14mmnc39nmf84i0av6j9glazjic7wzv1qyhr0j5966s3s1kfg")))) | |
203 | (build-system python-build-system) | |
204 | (arguments '(#:tests? #false)) ; there are no tests | |
205 | (propagated-inputs | |
206 | `(("python-pygments" ,python-pygments))) | |
207 | (home-page "https://jupyter.org") | |
208 | (synopsis "Pygments theme using JupyterLab CSS variables") | |
209 | (description | |
210 | "This package contains a syntax coloring theme for pygments making use of | |
211 | the JupyterLab CSS variables.") | |
212 | (license license:bsd-3))) | |
74d2d7a3 | 213 | |
a26dd2e2 RW |
214 | (define-public python-jupyter-packaging |
215 | (package | |
216 | (name "python-jupyter-packaging") | |
217 | (version "0.9.1") | |
218 | (source | |
219 | (origin | |
220 | (method url-fetch) | |
221 | (uri (pypi-uri "jupyter_packaging" version)) | |
222 | (sha256 | |
223 | (base32 | |
224 | "0r015c0m713d19asmpimsw6bk2sqv2lpd2nccgjzjdj5h1crg0bg")))) | |
225 | (build-system python-build-system) | |
226 | (propagated-inputs | |
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))) | |
232 | (native-inputs | |
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))) | |
244 | ||
4cb61205 RW |
245 | (define-public python-jupyterlab-widgets |
246 | (package | |
247 | (name "python-jupyterlab-widgets") | |
248 | (version "1.0.0") | |
249 | (source | |
250 | (origin | |
251 | (method url-fetch) | |
252 | (uri (pypi-uri "jupyterlab_widgets" version)) | |
253 | (sha256 | |
254 | (base32 | |
255 | "0y7vhhas3qndiypcpcfnhrj9n92v2w4hdc86nn620s9h9nl2j6jw")))) | |
256 | (build-system python-build-system) | |
257 | (native-inputs | |
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))) | |
265 | ||
74d2d7a3 RW |
266 | (define-public python-nbclient |
267 | (package | |
268 | (name "python-nbclient") | |
269 | (version "0.5.3") | |
270 | (source | |
271 | (origin | |
272 | (method url-fetch) | |
273 | (uri (pypi-uri "nbclient" version)) | |
274 | (sha256 | |
275 | (base32 | |
276 | "172q4r6mq0lg394di0pc6ipvniy14jg38wkdsj48r366609jf5yv")))) | |
277 | (build-system python-build-system) | |
278 | ;; Tests require a kernel via python-ipykernel, and also tools from | |
279 | ;; nbconvert. | |
280 | (arguments '(#:tests? #false)) | |
281 | (propagated-inputs | |
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))) | |
287 | (native-inputs | |
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") | |
309 | (description | |
310 | "This package provides a client library for executing notebooks. Formerly | |
311 | nbconvert's @code{ExecutePreprocessor.}") | |
312 | (license license:bsd-3))) |