projects/guix·blob java-team · refs

2339 lines · 87.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Federico Beffa <[email protected]>
3;;; Copyright © 2016, 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2016, 2019, 2021-2025 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2016, 2020, 2021 Efraim Flashner <[email protected]>
6;;; Copyright © 2016 Christopher Baines <[email protected]>
7;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
8;;; Copyright © 2018, 2019, 2021-2023 Ludovic Courtès <[email protected]>
9;;; Copyright © 2019, 2022 Andreas Enge <[email protected]>
10;;; Copyright © 2019 Edouard Klein <[email protected]>
11;;; Copyright © 2021 Hugo Lecomte <[email protected]>
12;;; Copyright © 2021 Lars-Dominik Braun <[email protected]>
13;;; Copyright © 2021 Nicolas Goaziou <[email protected]>
14;;; Copyright © 2021, 2022 Marius Bakke <[email protected]>
15;;; Copyright © 2022 Mădălin Ionel Patrașcu <[email protected]>
16;;; Copyright © 2022, 2024 Maxim Cournoyer <[email protected]>
17;;; Copyright © 2022 Maxime Devos <[email protected]>
18;;; Copyright © 2023 Antero Mejr <[email protected]>
19;;; Copyright © 2023 Greg Hogan <[email protected]>
20;;; Copyright © 2024 Danny Milosavljevic <[email protected]>
21;;; Copyright © 2024 Nicolas Graves <[email protected]>
22;;; Copyright © 2024, 2025 Nicolas Graves <[email protected]>
23;;; Copyright © 2024-2025 Sharlatan Hellseher <[email protected]>
24;;; Copyright © 2025 Ghislain Vaillant <[email protected]>
25;;; Copyright © 2026 Vinicius Monego <[email protected]>
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages jupyter)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix gexp)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system pyproject)
50 #:use-module (guix utils)
51 #:use-module (gnu packages algebra)
52 #:use-module (gnu packages bash)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages cpp)
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages docker)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages machine-learning)
60 #:use-module (gnu packages monitoring)
61 #:use-module (gnu packages networking)
62 #:use-module (gnu packages nss)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages python-build)
66 #:use-module (gnu packages python-check)
67 #:use-module (gnu packages python-crypto)
68 #:use-module (gnu packages python-science)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages python-web)
71 #:use-module (gnu packages qt)
72 #:use-module (gnu packages rdf)
73 #:use-module (gnu packages readline)
74 #:use-module (gnu packages time)
75 #:use-module (gnu packages xml)
76 #:use-module (gnu packages tls)
77 #:use-module (gnu packages ssh)
78 #:use-module (gnu packages sphinx)
79 #:use-module (gnu packages serialization)
80 #:use-module (gnu packages version-control)
81 #:use-module (gnu packages xorg))
82
83(define-public jupyter
84 (package
85 (name "jupyter")
86 (version "1.0.0")
87 (source
88 (origin
89 (method url-fetch)
90 (uri (pypi-uri "jupyter" version))
91 (sha256
92 (base32
93 "0pwf3pminkzyzgx5kcplvvbvwrrzd3baa7lmh96f647k30rlpp6r"))))
94 (build-system pyproject-build-system)
95 (arguments
96 (list
97 #:tests? #f ;there are none.
98 #:phases
99 ;; TODO python-team: Because python-jsonschema has an old
100 ;; python-webcolor. Remove this when python-team branch is merged.
101 #~(modify-phases %standard-phases
102 (delete 'sanity-check))))
103 (native-inputs (list python-setuptools))
104 (propagated-inputs
105 (list python-ipykernel
106 python-ipywidgets
107 python-jupyter-console
108 python-nbconvert
109 python-notebook
110 python-qtconsole))
111 (home-page "https://jupyter.org")
112 (synopsis "Web application for interactive documents")
113 (description
114 "The Jupyter Notebook is a web application that allows you to create and
115share documents that contain live code, equations, visualizations and
116explanatory text. Uses include: data cleaning and transformation, numerical
117simulation, statistical modeling, machine learning and much more.")
118 (license license:bsd-3)))
119
120(define-public python-ipykernel-7
121 (package
122 (name "python-ipykernel")
123 (version "7.1.0")
124 (source
125 (origin
126 (method url-fetch)
127 (uri (pypi-uri "ipykernel" version))
128 (sha256
129 (base32 "1nzhkkfcbvb53q0f40gqwk6qla3ddk3fmivdak1k0n9xaf4gr8sq"))))
130 (build-system pyproject-build-system)
131 (arguments
132 (list
133 ;; tests: 191 passed, 17 skipped, 1 deselected, 22 warnings
134 #:test-flags
135 ;; ImportError: Cannot load backend 'tkagg' which requires the 'tk'
136 ;; interactive framework, as 'headless' is currently running
137 #~(list "--deselect=tests/test_matplotlib_eventloops.py::test_matplotlib_gui[tk]")
138 #:phases
139 #~(modify-phases %standard-phases
140 ;; XXX: Requirement.parse('jupyter-client>=8.0.0'), {'ipykernel'})
141 (delete 'sanity-check)
142 (add-after 'unpack 'fix-pytest-config
143 (lambda _
144 (substitute* "pyproject.toml"
145 ;; Do not fail on warnings.
146 (("\"error\",") ""))))
147 ;; The deprecation warnings break the tests.
148 (add-before 'check 'pre-check
149 (lambda _
150 ;; jupyter-core demands this be set.
151 (setenv "JUPYTER_PLATFORM_DIRS" "1")
152 (setenv "HOME" "/tmp")))
153 (add-after 'install 'set-python-file-name
154 (lambda* (#:key inputs #:allow-other-keys)
155 ;; Record the absolute file name of the 'python' executable in
156 ;; 'kernel.json'.
157 (substitute* (string-append #$output "/share/jupyter"
158 "/kernels/python3/kernel.json")
159 (("\"python\"")
160 (format #f "~s" (search-input-file inputs
161 "/bin/python3")))))))))
162 (propagated-inputs
163 (list python-comm
164 python-debugpy
165 python-ipython
166 python-jupyter-client-7
167 python-jupyter-core
168 python-matplotlib-inline
169 python-nest-asyncio
170 python-packaging
171 python-psutil
172 python-pyzmq
173 python-tornado
174 python-traitlets))
175 (inputs (list python)) ;for cross compilation
176 (native-inputs
177 (list python-flaky
178 python-hatchling
179 python-ipyparallel-bootstrap
180 python-pytest
181 python-pytest-asyncio-0.26
182 python-pytest-timeout))
183 (home-page "https://ipython.org")
184 (synopsis "IPython Kernel for Jupyter")
185 (description "This package provides the IPython kernel for Jupyter.")
186 (license license:bsd-3)))
187
188(define-public python-ipykernel-6
189 (package
190 (name "python-ipykernel")
191 ;; XXX: The higher versions need jupyter_client>7, we are not ready yet,
192 ;; see: <https://codeberg.org/guix/guix/issues/5955>.
193 (version "6.29.5")
194 (source
195 (origin
196 (method url-fetch)
197 (uri (pypi-uri "ipykernel" version))
198 (sha256
199 (base32 "05b2qn0wzrg8dpnqsryr7fqwlgdrghlrq2ikis7q5y2098na54zh"))))
200 (build-system pyproject-build-system)
201 (arguments
202 (list
203 #:test-flags
204 #~(list "-Wignore::DeprecationWarning"
205 "--deselect=tests/inprocess/test_kernel.py::test_pylab")
206 #:phases
207 #~(modify-phases %standard-phases
208 (add-before 'check 'pre-check
209 (lambda _
210 ;; jupyter-core demands this be set.
211 (setenv "JUPYTER_PLATFORM_DIRS" "1")
212 (setenv "HOME" "/tmp")))
213 (add-after 'install 'set-python-file-name
214 (lambda* (#:key inputs #:allow-other-keys)
215 ;; Record the absolute file name of the 'python' executable in
216 ;; 'kernel.json'.
217 (substitute* (string-append #$output "/share/jupyter"
218 "/kernels/python3/kernel.json")
219 (("\"python\"")
220 (format #f "~s" (search-input-file inputs
221 "/bin/python3")))))))))
222 (native-inputs
223 (list python-flaky
224 python-hatchling
225 python-ipyparallel-bootstrap
226 python-pytest-8
227 python-pytest-asyncio-0.26 ;some tests fail with v1
228 python-pytest-timeout))
229 (inputs (list python)) ;for cross compilation
230 (propagated-inputs
231 (list python-comm
232 python-debugpy
233 python-ipython
234 python-jupyter-client
235 python-jupyter-core
236 python-matplotlib-inline
237 python-nest-asyncio
238 python-packaging
239 python-psutil
240 python-pyzmq
241 python-tornado
242 python-traitlets))
243 (home-page "https://ipython.org")
244 (synopsis "IPython Kernel for Jupyter")
245 (description "This package provides the IPython kernel for Jupyter.")
246 (license license:bsd-3)))
247
248(define-public python-ipykernel python-ipykernel-6)
249
250;; Bootstrap variant of ipykernel, which uses the bootstrap jupyter-client to
251;; break the cycle between ipykernel and jupyter-client.
252(define-public python-ipykernel-bootstrap
253 (let ((parent python-ipykernel))
254 (hidden-package
255 (package
256 (inherit parent)
257 (name "python-ipykernel-bootstrap")
258 (arguments (list #:tests? #f
259 ;; The package should normally propagate ipykernel,
260 ;; left out here to break the cycle.
261 #:phases #~(modify-phases %standard-phases
262 (delete 'sanity-check))))
263 (native-inputs (list python-hatchling))
264 (propagated-inputs
265 (modify-inputs propagated-inputs
266 (replace "python-jupyter-client" python-jupyter-client-bootstrap)))))))
267
268(define-public python-jupytext
269 (package
270 (name "python-jupytext")
271 (version "1.18.1")
272 (source
273 (origin
274 (method git-fetch)
275 (uri (git-reference
276 (url "https://github.com/mwouts/jupytext")
277 (commit (string-append "v" version))))
278 (file-name (git-file-name name version))
279 (sha256
280 (base32 "01vvi5aab7lahj57ng5v4svjw18xrlgnasz877lqvdf4m6cpi8s9"))))
281 (build-system pyproject-build-system)
282 (arguments
283 (list
284 ;; tests: 4016 passed, 173 skipped, 3 deselected, 1 warning
285 #:test-flags
286 #~(list
287 ;; Requires git.
288 "--ignore=tests/external"
289 ;; Requires python-black.
290 "--ignore=tests/functional/contents_manager"
291 ;; Failed: DID NOT RAISE <class 'ValueError'>.
292 (string-append "--deselect=tests/functional/cli/test_source_is_newer.py"
293 "::test_check_source_is_newer_when_using_jupytext_to")
294 ;; Failed: DID NOT RAISE <class 'jupytext.cli.SynchronousModificationError'>.
295 (string-append "--deselect=tests/functional/cli/test_synchronous_changes.py"
296 "::test_jupytext_to_raises_on_synchronous_edits")
297 ;; Failed: DID NOT RAISE <class 'jupytext.cli.SynchronousModificationError'>.
298 (string-append "--deselect=tests/functional/cli/test_synchronous_changes.py"
299 "::test_jupytext_sync_raises_on_synchronous_edits"))
300 #:phases
301 #~(modify-phases %standard-phases
302 (add-before 'check 'pre-check
303 (lambda _
304 ;; some tests fail when HOME=/homeless-shelter.
305 (setenv "HOME" "/tmp")
306 ;; OSError: [Errno 18] Invalid cross-device link
307 (setenv "TMPDIR" "/tmp"))))))
308 (native-inputs
309 (list python-hatchling
310 python-jupyter-client
311 python-jupyter-server
312 python-pytest
313 python-pytest-asyncio))
314 (propagated-inputs
315 (list python-markdown-it-py
316 python-mdit-py-plugins
317 python-nbformat
318 python-packaging
319 python-pyyaml))
320 (home-page "https://jupytext.readthedocs.io/")
321 (synopsis
322 "Jupyter notebooks as Markdown documents, Julia, Python or R scripts")
323 (description
324 "Jupytext is a plugin for Jupyter that can save Jupyter notebooks as
325either Markdown files or scripts in many languages. Common use cases for
326Jupytext are:
327
328@itemize
329@item version control on Jupyter Notebooks
330@item editing, merging or refactoring notebooks in your favorite text editor
331@item applying Q&A checks on notebooks.
332@end itemize ")
333 (license license:expat)))
334
335(define-public python-nbclassic
336 (package
337 (name "python-nbclassic")
338 (version "1.3.3")
339 (source
340 (origin
341 (method url-fetch)
342 (uri (pypi-uri "nbclassic" version))
343 (sha256
344 (base32 "1rpflcd8rz5s627apaqdcfpr3c8d6x1glvfd311pbvlc7xv2hhj3"))))
345 (build-system pyproject-build-system)
346 (propagated-inputs (list python-ipykernel
347 python-ipython-genutils
348 python-nest-asyncio
349 python-notebook-shim))
350 (native-inputs (list python-babel
351 python-hatch-jupyter-builder
352 python-hatchling
353 python-nbval
354 python-pytest
355 python-pytest-jupyter))
356 (home-page "https://github.com/jupyter/nbclassic")
357 (synopsis "Jupyter Notebook as a Jupyter Server extension")
358 (description "NbClassic provides a backwards compatible Jupyter Notebook
359interface that you can install side-by-side with the latest versions: That
360way, you can fearlessly upgrade without worrying about your classic extensions
361and customizations breaking. Because NbClassic provides the classic interface
362on top of the new Jupyter Server backend, it can coexist with other frontends
363like JupyterLab and Notebook 7 in the same installation. NbClassic preserves
364the custom classic notebook experience under a new set of URL endpoints, under
365the namespace @code{/nbclassic/}.")
366 (license license:bsd-3)))
367
368(define-public python-notebook
369 (package
370 (name "python-notebook")
371 ;; XXX: Newer version requires Jupyterlab, see:
372 ;; <https://codeberg.org/guix/guix/pulls/2073>.
373 (version "6.5.7")
374 (source (origin
375 (method url-fetch)
376 (uri (pypi-uri "notebook" version))
377 (sha256
378 (base32
379 "1r38fwr0r4xgkz8y27w3xyz2dk97ih5azba28jylyqxcvw8r1sq4"))))
380 (build-system pyproject-build-system)
381 (arguments
382 (list
383 ;; tests: 305 passed, 7 skipped, 18 deselected, 2696 warning
384 #:test-flags
385 '(list "-k" (string-append
386 ;; TODO: This tests fails because nbconvert does not
387 ;; list "python" as a format.
388 "not test_list_formats"
389 ;; AssertionError: Lists differ:
390 " and not test_disable"
391 " and not test_enable"
392 " and not test_merge_config"
393 " and not test_load_ordered"
394 " and not test_list_running_sock_servers"
395 " and not test_run"
396 ;; tornado.simple_httpclient.HTTPTimeoutError: Timeout
397 ;; during request
398 " and not test_connections")
399 ;; AttributeError: 'TestContentsManager' object has no attribute
400 ;; 'assertDictContainsSubset'
401 (string-append "--deselect=notebook/services/contents/tests/"
402 "test_manager.py::TestContentsManager::test_get")
403 (string-append "--deselect=notebook/services/contents/tests/"
404 "test_manager.py::TestContentsManagerNoAtomic::test_get")
405 ;; These tests require a browser.
406 "--ignore=notebook/tests/selenium")
407 #:phases
408 '(modify-phases %standard-phases
409 (add-after 'unpack 'use-our-home-for-tests
410 (lambda _
411 ;; The 'get_patch_env' function in this file reads:
412 ;; 'HOME': cls.home_dir
413 ;; but for some reason, that definition of HOME is not what the
414 ;; GLib/GIO trash mechanism honors, which would cause test
415 ;; failures. Instead, set 'HOME' here to an existing directory
416 ;; and let the tests honor it.
417 (substitute* "notebook/tests/launchnotebook.py"
418 (("'HOME': .*," all)
419 (string-append "# " all "\n")))
420 (setenv "HOME" (getcwd))))
421 ;; Because python-jsonschema has an old python-webcolor. Remove this
422 ;; when python-team branch is merged.
423 (delete 'sanity-check)
424 (add-before 'check 'pre-check
425 (lambda _
426 ;; Interferes with test expectations.
427 (unsetenv "JUPYTER_CONFIG_PATH")
428 ;; Some tests do not expect all files to be installed in the
429 ;; same directory, but JUPYTER_PATH contains multiple entries.
430 (unsetenv "JUPYTER_PATH"))))))
431 (propagated-inputs
432 (list python-argon2-cffi
433 python-ipykernel
434 python-ipython-genutils
435 python-jinja2
436 python-jupyter-client-7
437 python-jupyter-core
438 python-nest-asyncio
439 python-nbclassic
440 python-nbconvert
441 python-nbformat
442 python-prometheus-client
443 python-pyzmq
444 python-send2trash
445 python-terminado
446 python-tornado
447 python-traitlets))
448 (native-inputs
449 (list python-jupyter-server
450 python-nbval
451 python-pytest
452 python-requests
453 python-requests-unixsocket2
454 python-setuptools))
455 (home-page "https://jupyter.org/")
456 (synopsis "Web-based notebook environment for interactive computing")
457 (description
458 "The Jupyter HTML notebook is a web-based notebook environment for
459interactive computing.")
460 (license license:bsd-3)))
461
462(define-public python-notebook-shim
463 (package
464 (name "python-notebook-shim")
465 (version "0.2.4")
466 (source
467 (origin
468 (method url-fetch)
469 (uri (pypi-uri "notebook_shim" version))
470 (sha256
471 (base32 "1jrqqrm5xjwsx13plyyh7wybb1g71yrzaqa3l9y3162xnshwzcml"))))
472 (build-system pyproject-build-system)
473 (propagated-inputs (list python-jupyter-server))
474 (native-inputs
475 (list python-hatchling
476 python-pytest
477 python-pytest-console-scripts
478 python-pytest-jupyter
479 python-pytest-tornasync))
480 (home-page "https://pypi.org/project/notebook-shim/")
481 (synopsis "Shim layer for notebook traits and config")
482 (description
483 "This project provides a way for JupyterLab and other frontends to switch
484to Jupyter Server for their Python Web application backend.")
485 (license license:bsd-3)))
486
487(define-public python-jupyter-client-8
488 (package
489 (name "python-jupyter-client")
490 (version "8.7.0")
491 (source
492 (origin
493 (method url-fetch)
494 (uri (pypi-uri "jupyter_client" version))
495 (sha256
496 (base32 "07akcardg15d6c21x3g8yjj8gwz1lyinf3qrb6g200dykhnj2mrk"))))
497 (build-system pyproject-build-system)
498 (arguments
499 (list
500 ;; tests: 227 passed, 7 skipped, 27 warnings
501 #:tests? (not (%current-target-system))
502 #:phases
503 #~(modify-phases %standard-phases
504 (add-after 'unpack 'fix-pytest-config
505 (lambda _
506 (substitute* "pyproject.toml"
507 ;; Do not fail on warnings.
508 (("\"error\",") ""))))
509 (add-before 'check 'pre-check
510 (lambda _
511 ;; Some tests try to write to $HOME.
512 (setenv "HOME" "/tmp")
513 ;; jupyter-core demands this be set.
514 (setenv "JUPYTER_PLATFORM_DIRS" "1")
515 ;; dont depend on openssh
516 ;; it does not actually call it
517 ;; just asserts that a ssh is in PATH
518 (let* ((tmp (getenv "TMPDIR"))
519 (ssh (in-vicinity tmp "ssh")))
520 (symlink (which "false") ssh)
521 (setenv "PATH" (string-append tmp ":" (getenv "PATH"))))))
522 (add-after 'check 'fix-syntax-error
523 ;; Hatchling seems to generate entry scripts with invalid imports.
524 (lambda _
525 (substitute* (string-append #$output "/bin/.jupyter-kernelspec-real")
526 (("import KernelSpecApp.launch_instance") "import KernelSpecApp")))))))
527 (native-inputs
528 (list python-anyio
529 python-hatchling
530 python-ipykernel-bootstrap
531 python-pytest
532 python-pytest-jupyter-minimal
533 python-pytest-timeout))
534 (inputs
535 (list iproute ;ip jupyter_client/localinterfaces.py
536 net-tools ;ifconfig jupyter_client/localinterfaces.py
537 ))
538 (propagated-inputs
539 (list python-dateutil
540 python-jupyter-core
541 python-pyzmq
542 python-tornado
543 python-traitlets))
544 (home-page "https://jupyter.org/")
545 (synopsis "Jupyter protocol implementation and client libraries")
546 (description
547 "The @code{jupyter_client} package contains the reference implementation
548of the Jupyter protocol. It also provides client and kernel management APIs
549for working with kernels, and the @code{jupyter kernelspec} entrypoint for
550installing @code{kernelspec}s for use with Jupyter frontends.")
551 (license license:bsd-3)))
552
553(define-public python-jupyter-client-7
554 (package
555 (inherit python-jupyter-client-8)
556 (name "python-jupyter-client")
557 (version "7.4.9")
558 (source
559 (origin
560 (method url-fetch)
561 (uri (pypi-uri "jupyter_client" version))
562 (sha256
563 (base32 "14nkh0w0q5xfjqc6rgnbx7zbjajmb9m63q90iznpmw3i87h2igjj"))))
564 ;; tests: 180 passed, 4 skipped, 1 warning
565 (native-inputs
566 (list python-hatchling
567 python-ipykernel-bootstrap
568 python-pytest
569 python-pytest-asyncio
570 python-pytest-jupyter-minimal
571 python-pytest-timeout))
572 (propagated-inputs
573 (list python-dateutil
574 python-entrypoints
575 python-jupyter-core
576 python-nest-asyncio
577 python-pyzmq
578 python-tornado
579 python-traitlets))))
580
581(define-public python-jupyter-client python-jupyter-client-7)
582
583;; Bootstrap variant of jupyter-client, which breaks the loop between ipykernel
584;; and jupyter-client by removing the former from its native-inputs and
585;; disabling tests.
586(define-public python-jupyter-client-bootstrap
587 (hidden-package
588 (package/inherit python-jupyter-client
589 (name "python-jupyter-client-bootstrap")
590 (arguments
591 (substitute-keyword-arguments arguments
592 ((#:tests? _) #f)))
593 (native-inputs
594 (list python-hatchling)))))
595
596(define-public python-jupyter-console
597 (package
598 (name "python-jupyter-console")
599 (version "6.6.3")
600 (source
601 (origin
602 (method url-fetch)
603 (uri (pypi-uri "jupyter_console" version))
604 (sha256
605 (base32
606 "0f9mllaavanqlimiv9sxxmqrmdb961p89prcyanvzbc73krlnsjn"))))
607 (build-system pyproject-build-system)
608 (arguments
609 (list
610 #:test-flags
611 ;; ModuleNotFoundError: No module named 'traitlets'
612 #~(list "--deselect=jupyter_console/tests/test_console.py::test_generate_config")
613 #:phases
614 #~(modify-phases %standard-phases
615 (add-before 'check 'pre-check
616 (lambda _
617 (setenv "HOME" "/tmp"))))))
618 (native-inputs
619 (list python-flaky
620 python-hatchling
621 python-pytest))
622 (propagated-inputs
623 (list python-ipykernel
624 python-ipython
625 python-jupyter-client
626 python-jupyter-core
627 python-prompt-toolkit
628 python-pygments
629 python-pyzmq
630 python-traitlets))
631 (home-page "https://jupyter.org")
632 (synopsis "Jupyter terminal console")
633 (description "This package provides a terminal-based console frontend for
634Jupyter kernels. It also allows for console-based interaction with non-Python
635Jupyter kernels such as IJulia and IRKernel.")
636 (license license:bsd-3)))
637
638(define-public python-jupyter-core
639 (package
640 (name "python-jupyter-core")
641 (version "5.9.1")
642 (source
643 (origin
644 (method url-fetch)
645 (uri (string-append (pypi-uri "jupyter_core" version)))
646 (sha256
647 (base32 "022mbd3dyg3chkcgg77qyn8mrzw9s05mhzv5rv1nd59v63zsl2ad"))))
648 (build-system pyproject-build-system)
649 (arguments
650 (list
651 ;; tests: 73 passed, 20 skipped, 4 deselected
652 #:test-flags
653 ;; These tests try to unset environment variables, search for `jupyter`,
654 ;; write test files and fail eventually.
655 #~(list "--deselect=tests/test_command.py::test_not_on_path"
656 "--deselect=tests/test_command.py::test_path_priority"
657 "--deselect=tests/test_command.py::test_argv0"
658 ;; Expecting `pip` in the PATH.
659 "--deselect=tests/test_troubleshoot.py::test_troubleshoot")
660 #:phases
661 #~(modify-phases %standard-phases
662 ;; Migration is running whenever etc/jupyter exists, but the
663 ;; Guix-managed directory will never contain any migratable IPython
664 ;; config files and cannot be written to anyway, so just pretend we
665 ;; already did that.
666 (add-after 'install 'disable-migration
667 (lambda _
668 (let* ((etc (string-append #$output "/etc/jupyter"))
669 (migrated (string-append etc "/migrated")))
670 (mkdir-p etc)
671 (with-output-to-file migrated
672 (const (display "\n"))))))
673 (add-before 'check 'pre-check
674 (lambda _
675 (setenv "HOME" "/tmp"))))))
676 (native-inputs
677 (list python-hatchling
678 python-pytest))
679 (propagated-inputs
680 (list python-platformdirs
681 python-traitlets))
682 ;; This package provides the `jupyter` binary and thus also exports the
683 ;; search paths.
684 (native-search-paths
685 (list (search-path-specification
686 (variable "JUPYTER_CONFIG_PATH")
687 (files '("etc/jupyter")))
688 (search-path-specification
689 (variable "JUPYTER_PATH")
690 (files '("share/jupyter")))))
691 (home-page "https://jupyter.org/")
692 (synopsis "Jupyter base package")
693 (description
694 "Jupyter core is the base package on which Jupyter projects rely.")
695 (license license:bsd-3)))
696
697(define-public python-jupyter-lsp
698 (package
699 (name "python-jupyter-lsp")
700 (version "2.3.0")
701 (source
702 (origin
703 (method url-fetch)
704 (uri (pypi-uri "jupyter_lsp" version))
705 (sha256
706 (base32 "0i825shcn9d3f7a5zmvcj1p87s5wgpqn8cyphjvqz1nw769sb2j5"))))
707 (build-system pyproject-build-system)
708 (arguments
709 (list
710 ;; tests: 63 passed, 8 skipped, 1 deselected, 20 warnings
711 #:test-flags
712 ;; Network access is required or most tests failed.
713 #~(list "--ignore=jupyter_lsp/tests/test_listener.py"
714 "--ignore=jupyter_lsp/tests/test_session.py"
715 ;; No R language server is present.
716 "-k" "not test_r_package_detection")
717 #:phases
718 #~(modify-phases %standard-phases
719 ;; Some tests require a writable HOME
720 (add-before 'check 'set-HOME
721 (lambda _ (setenv "HOME" "/tmp"))))))
722 (native-inputs
723 (list python-pytest
724 python-pytest-asyncio
725 python-setuptools))
726 (propagated-inputs (list python-jupyter-server))
727 (home-page "https://pypi.org/project/jupyter-lsp/")
728 (synopsis "Multi-Language Server WebSocket proxy for Jupyter Notebook/Lab server")
729 (description
730 "This package provides a multi-language server WebSocket proxy for
731Jupyter Notebook/Lab server. It provides coding assistance for
732JupyterLab (code navigation, hover suggestions, linters, autocompletion, and
733rename) using the Language Server Protocol.")
734 (license license:bsd-3)))
735
736(define-public python-jupyter-kernel-client
737 ;; No tags upstream for recent versions.
738 (let ((commit "ffc57eee7db20cc7acf0417d580b7b63d7ddda43")
739 (revision "0"))
740 (package
741 (name "python-jupyter-kernel-client")
742 (version (git-version "0.9.0" revision commit))
743 (source
744 (origin
745 (method git-fetch)
746 (uri (git-reference
747 (url "https://github.com/datalayer/jupyter-kernel-client")
748 (commit commit)))
749 (file-name (git-file-name name version))
750 (sha256
751 (base32 "0mdb7n5yw39lbwf8g5a55ar1327v46r5hk8mvs07bzpmz0979c5h"))))
752 (build-system pyproject-build-system)
753 (arguments
754 (list
755 ;; All tests timeout.
756 #:tests? #f))
757 (propagated-inputs
758 (list python-jupyter-client
759 python-jupyter-core
760 python-jupyter-client
761 python-jupyter-core
762 python-requests
763 python-traitlets
764 python-websocket-client))
765 (native-inputs
766 (list python-hatchling
767 python-ipykernel
768 python-jupyter-server
769 python-jupyter-mimetypes
770 python-pandas
771 python-pytest
772 python-pytest-asyncio
773 python-pytest-timeout))
774 (home-page "https://github.com/datalayer/jupyter-kernel-client")
775 (synopsis "Connect to Jupyter Kernel through HTTP or WebSockets")
776 (description
777 "This package provides a library to conncet to live Jupyter Kernels
778through HTTP and WebSocket.")
779 (license license:bsd-3))))
780
781(define-public python-jupyter-kernel-test
782 (package
783 (name "python-jupyter-kernel-test")
784 (version "0.7.0")
785 (source
786 (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/jupyter/jupyter_kernel_test")
790 (commit (string-append "v" version))))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32 "1xp8496kr79rvb5b2m7kgwzdppfcmn4mqc0anjkqk7d91hr1wssf"))))
794 (build-system pyproject-build-system)
795 (arguments
796 (list
797 #:phases
798 #~(modify-phases %standard-phases
799 (replace 'check
800 (lambda* (#:key tests? #:allow-other-keys)
801 (when tests?
802 (invoke "python" "-m" "unittest" "-v")))))))
803 (native-inputs
804 (list python-hatchling
805 python-ipykernel))
806 (propagated-inputs
807 (list python-jsonschema
808 python-jupyter-client))
809 (home-page "https://github.com/jupyter/jupyter_kernel_test")
810 (synopsis "Test Jupyter kernels")
811 (description
812 "@code{jupyter_kernel_test} is a tool for testing Jupyter kernels. It
813tests kernels for successful code execution and conformance with the
814@uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
815Messaging Protocol}.")
816 (license license:bsd-3)))
817
818(define-public python-pari-jupyter
819 (package
820 (name "python-pari-jupyter")
821 (version "1.4.3")
822 (source
823 (origin
824 (method url-fetch)
825 (uri (pypi-uri "pari-jupyter" version))
826 (sha256
827 (base32 "178v8y3sj3lh3y8i7krbmjqvmv7549bg535fqq1q6axr0lfjknbw"))))
828 (build-system pyproject-build-system)
829 (arguments
830 (list #:tests? #f)) ; there are no proper tests
831 (native-inputs
832 (list python-cython
833 python-jupyter-kernel-test
834 python-setuptools
835 python-wheel))
836 (inputs
837 (list pari-gp
838 readline))
839 (propagated-inputs
840 (list python-ipykernel))
841 (home-page "https://github.com/sagemath/pari-jupyter")
842 (synopsis "Jupyter kernel for PARI/GP")
843 (description "The package provides a PARI/GP kernel for Jupyter.")
844 (license license:gpl3+)))
845
846(define-public python-pytest-jupyter
847 (package
848 (name "python-pytest-jupyter")
849 (version "0.10.1")
850 (source
851 (origin
852 (method url-fetch)
853 (uri (pypi-uri "pytest_jupyter" version))
854 (sha256
855 (base32 "114y9py29j6p2iymhc3vj55x65gg1ncbhwal5mads0g2z7p59pq0"))))
856 (build-system pyproject-build-system)
857 (arguments
858 (list
859 #:test-flags
860 ;; This requires python-jupyter-server, which itself requires this
861 ;; package.
862 '(list "--ignore=tests/test_jupyter_server.py")
863 #:phases
864 '(modify-phases %standard-phases
865 ;; The jupyter_server tests requires python-jupyter-server, which
866 ;; itself requires this package.
867 (add-after 'unpack 'disable-tests
868 (lambda _
869 (substitute* "tests/conftest.py"
870 (("\"pytest_jupyter.jupyter_server\",") ""))))
871 ;; Some tests require a writable HOME
872 (add-before 'check 'set-HOME
873 (lambda _ (setenv "HOME" "/tmp")))
874 (add-after 'unpack 'ignore-deprecation-warnings
875 (lambda _
876 (substitute* "pyproject.toml"
877 ((" \"module:datetime.*" m)
878 (string-append m "\n\"ignore:zmq.eventloop.ioloop is deprecated:DeprecationWarning\","))))))))
879 (propagated-inputs (list python-jupyter-core python-nbformat))
880 (native-inputs (list python-hatchling
881 python-ipykernel
882 python-pytest
883 python-pytest-timeout
884 python-tornado))
885 (home-page "https://jupyter.org")
886 (synopsis "Pytest plugin for testing Jupyter libraries and extensions.")
887 (description
888 "This package provides a pytest plugin for testing Jupyter libraries and
889extensions.")
890 (license license:bsd-4)))
891
892(define-public python-pytest-jupyter-minimal
893 (package/inherit python-pytest-jupyter
894 (name "python-pytest-jupyter-minimal")
895 (arguments
896 (list #:tests? #f))
897 (native-inputs
898 (list python-hatchling))
899 (propagated-inputs
900 (list python-jupyter-core))))
901
902(define-public python-terminado
903 (package
904 (name "python-terminado")
905 (version "0.18.1")
906 (source
907 (origin
908 (method url-fetch)
909 (uri (pypi-uri "terminado" version))
910 (sha256
911 (base32
912 "0bpxag3n0148vsgmi6wh3ynmprykazzqys0lfxgpdr2xp32g42fy"))))
913 (build-system pyproject-build-system)
914 (arguments
915 (list
916 #:test-flags #~(list "-W" "default"))) ;taken from pyproject.toml
917 (native-inputs
918 (list python-hatchling
919 python-pytest
920 python-pytest-timeout))
921 (propagated-inputs
922 (list python-ptyprocess
923 python-tornado))
924 (home-page "https://github.com/jupyter/terminado")
925 (synopsis "Terminals served to term.js using Tornado websockets")
926 (description "This package provides a Tornado websocket backend for the
927term.js Javascript terminal emulator library.")
928 (license license:bsd-2)))
929
930(define-public xeus
931 (package
932 (name "xeus")
933 (version "2.4.1")
934 (source (origin
935 (method git-fetch)
936 (uri (git-reference
937 (url "https://github.com/jupyter-xeus/xeus")
938 (commit version)))
939 (sha256
940 (base32
941 "1k1h416qkw3yra6ayfa61nv0v4ify2wvp5x27slgbcw6c88w7fb1"))
942 (file-name (git-file-name name version))))
943 (build-system cmake-build-system)
944 (arguments
945 '(#:tests? #f
946 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF"
947 "-DDISABLE_ARCH_NATIVE=ON"))) ;no '-march=native'
948 (native-inputs
949 (list pkg-config
950 ;; The following inputs are used by the test suite.
951 googletest
952 python-pytest
953 python-wrapper
954 python-jupyter-kernel-test
955 python-jupyter-client))
956 (inputs
957 (list xtl
958 nlohmann-json
959 cppzmq
960 zeromq
961 openssl
962 `(,util-linux "lib"))) ;libuuid
963 (home-page "https://quantstack.net/xeus")
964 (synopsis "C++ implementation of the Jupyter Kernel protocol")
965 (description
966 "@code{xeus} is a library meant to facilitate the implementation of
967kernels for Jupyter. It takes the burden of implementing the Jupyter Kernel
968protocol so developers can focus on implementing the interpreter part of the
969kernel.
970
971Several Jupyter kernels are built upon @code{xeus}, such as @code{xeus-cling},
972a kernel for the C++ programming language, and @code{xeus-python}, an
973alternative Python kernel for Jupyter.")
974 (license license:bsd-3)))
975
976(define-public python-jupyterlab-pygments
977 (package
978 (name "python-jupyterlab-pygments")
979 (version "0.1.2") ;newer versions requires Node.js packages
980 (source
981 (origin
982 (method url-fetch)
983 (uri (pypi-uri "jupyterlab_pygments" version))
984 (sha256
985 (base32
986 "0ij14mmnc39nmf84i0av6j9glazjic7wzv1qyhr0j5966s3s1kfg"))))
987 (build-system pyproject-build-system)
988 (arguments '(#:tests? #false)) ; there are no tests
989 (native-inputs
990 (list python-setuptools))
991 (propagated-inputs
992 (list python-pygments))
993 (home-page "https://jupyter.org")
994 (synopsis "Pygments theme using JupyterLab CSS variables")
995 (description
996 "This package contains a syntax coloring theme for pygments making use of
997the JupyterLab CSS variables.")
998 (license license:bsd-3)))
999
1000(define-public python-jupyterlab-server
1001 (package
1002 (name "python-jupyterlab-server")
1003 (version "2.27.1")
1004 (source
1005 (origin
1006 (method url-fetch)
1007 (uri (pypi-uri "jupyterlab_server" version))
1008 (sha256
1009 (base32 "07b3m34akrf79xpaim9cymhsac0ry5ry7if998lcfxmn173mlyq9"))))
1010 (build-system pyproject-build-system)
1011 (arguments
1012 (list
1013 #:test-flags
1014 ;; XXX: These tests appear to fail due to the lack of
1015 ;; locales.
1016 '(list "-k" "not locale and not language")
1017 #:phases
1018 '(modify-phases %standard-phases
1019 (add-after 'unpack 'ignore-deprecation-warnings
1020 (lambda _
1021 (substitute* "pyproject.toml"
1022 ((" \"module:datetime.*" m)
1023 (string-append
1024 m
1025 "\n\"ignore:zmq.eventloop.ioloop is deprecated:DeprecationWarning\","
1026 "\n\"ignore:There is no current event loop:DeprecationWarning\","
1027 "\n\"ignore:Spec is deprecated. Use SchemaPath from jsonschema-path package.:DeprecationWarning\"," )))))
1028 (add-before 'check 'set-HOME
1029 (lambda _ (setenv "HOME" "/tmp"))))))
1030 (propagated-inputs
1031 (list python-babel
1032 python-jinja2
1033 python-json5
1034 python-jsonschema
1035 python-jupyter-server
1036 python-packaging
1037 python-requests))
1038 (native-inputs
1039 (list python-hatchling
1040 python-ipykernel
1041 python-openapi-core
1042 python-openapi-spec-validator
1043 python-pytest
1044 python-pytest-console-scripts
1045 python-pytest-jupyter
1046 python-pytest-timeout
1047 python-requests-mock
1048 python-ruamel.yaml
1049 python-strict-rfc3339
1050 python-werkzeug
1051 python-wheel))
1052 (home-page "https://jupyter.org")
1053 (synopsis "Server components for JupyterLab applications")
1054 (description "JupyterLab Server sits between JupyterLab and Jupyter
1055Server, and provides a set of REST API handlers and utilities that are used by
1056JupyterLab. It is a separate project in order to accommodate creating
1057JupyterLab-like applications from a more limited scope.")
1058 (license license:bsd-3)))
1059
1060(define-public python-jupyter-events
1061 (package
1062 (name "python-jupyter-events")
1063 (version "0.12.1")
1064 (source
1065 (origin
1066 (method git-fetch)
1067 (uri (git-reference
1068 (url "https://github.com/jupyter/jupyter_events")
1069 (commit (string-append "v" version))))
1070 (file-name (git-file-name name version))
1071 (sha256
1072 (base32 "1n0jgk49kjiv6j6xnwnqfzw88zba7alh6m5gzq78gjvr1kf5cdir"))))
1073 (build-system pyproject-build-system)
1074 (arguments
1075 ;; This passes the whole command line to shutil.which, instead of just
1076 ;; the executable.
1077 (list #:test-flags '(list "--ignore=tests/test_cli.py")))
1078 (native-inputs
1079 (list python-click
1080 python-hatchling
1081 python-pytest
1082 python-rich
1083 python-pytest-asyncio
1084 python-pytest-console-scripts))
1085 (propagated-inputs
1086 (list python-jsonschema
1087 python-json-logger
1088 python-pyyaml
1089 python-referencing
1090 python-rfc3339-validator
1091 python-rfc3986-validator
1092 python-traitlets))
1093 (home-page "https://github.com/jupyter/jupyter_events")
1094 (synopsis "Jupyter Event System library")
1095 (description "Jupyter Events enables Jupyter Python
1096Applications (e.g. Jupyter Server, JupyterLab Server, JupyterHub, etc.) to
1097emit events—structured data describing things happening inside the
1098application. Other software (e.g. client applications like JupyterLab) can
1099listen and respond to these events.")
1100 (license license:bsd-3)))
1101
1102(define-public python-jupyter-mcp-server
1103 (package
1104 (name "python-jupyter-mcp-server")
1105 (version "1.0.2")
1106 (source
1107 (origin
1108 (method git-fetch)
1109 (uri (git-reference
1110 (url "https://github.com/datalayer/jupyter-mcp-server")
1111 (commit (string-append "v" version))))
1112 (file-name (git-file-name name version))
1113 (sha256
1114 (base32 "01p81lmcx44cb30w1m2c65p2pyyzdnq09b5xpv0m1ij9cw6x5x4h"))))
1115 (build-system pyproject-build-system)
1116 (arguments
1117 (list
1118 ;; 1 failed, 79 passed, 1 skipped, 72 deselected, 2 warnings, 22 errors
1119 #:tests? #f
1120 #:test-flags
1121 #~(list "-k" "not [jupyter_extension] and not [mcp_server]")))
1122 (propagated-inputs
1123 (list python-click
1124 python-fastapi
1125 python-httpx-sse
1126 python-jupyter-kernel-client
1127 ;; python-jupyter-mcp-tools
1128 python-jupyter-mimetypes
1129 python-jupyter-nbmodel-client
1130 python-jupyter-server-client
1131 ;; python-jupyter-server-nbmodel
1132 python-jupyter-server
1133 python-mcp
1134 python-opentelemetry-api
1135 python-opentelemetry-sdk
1136 python-pydantic
1137 python-sse-starlette
1138 python-tornado
1139 python-traitlets
1140 python-uvicorn))
1141 (native-inputs
1142 (list python-hatchling
1143 python-ipykernel
1144 ;; python-jupyter-collaboration
1145 python-jupyter-server
1146 ;; python-jupyterlab
1147 python-pillow
1148 python-pytest
1149 python-pytest-asyncio
1150 python-pytest-timeout))
1151 (home-page "https://github.com/datalayer/jupyter-mcp-server")
1152 (synopsis "Jupyter MCP Server")
1153 (description "This package provides a @acronym{Model Context Protocol,
1154MCP} server for @code{jupyter}, bridging LLMs and Jupyter Notebooks.")
1155 (license license:bsd-3)))
1156
1157(define-public python-jupyter-mimetypes
1158 ;; No tags upstream for recent versions.
1159 (let ((commit "463143eb4e4a988dffdefb0363e3cfaeee3a96ec")
1160 (revision "1"))
1161 (package
1162 (name "python-jupyter-mimetypes")
1163 (version (git-version "0.2.0" revision commit))
1164 (source
1165 (origin
1166 (method git-fetch)
1167 (uri (git-reference
1168 (url "https://github.com/datalayer/jupyter-mimetypes")
1169 (commit commit)))
1170 (file-name (git-file-name name version))
1171 (sha256
1172 (base32 "0nv96ldgsc1fpp6mkkc58rpnfhxj79brr04a2rggcyidx4ghyiba"))))
1173 (build-system pyproject-build-system)
1174 (arguments
1175 (list
1176 #:phases
1177 #~(modify-phases %standard-phases
1178 (add-before 'check 'pre-check
1179 (lambda _
1180 (setenv "HOME" (dirname (getcwd))))))))
1181 (propagated-inputs
1182 (list python-requests
1183 python-typing-extensions))
1184 (native-inputs
1185 (list python-hatchling
1186 python-ipython-minimal
1187 python-numpy
1188 python-pandas-2
1189 python-pyarrow
1190 python-pytest
1191 python-pytest-timeout
1192 python-pytorch))
1193 (home-page "https://github.com/datalayer/jupyter-mimetypes")
1194 (synopsis "Enhanced Jupyter representation capabilities")
1195 (description "This package Python provides enhanced Jupyter
1196representation capabilities through proxy objects, enabling efficient Apache
1197Arrow-based serialization for pandas DataFrames/Series and pickle-based
1198serialization for generic Python objects in Jupyter environments.")
1199 (license license:bsd-3))))
1200
1201(define-public python-jupyter-nbmodel-client
1202 (package
1203 (name "python-jupyter-nbmodel-client")
1204 (version "0.14.7")
1205 (source
1206 (origin
1207 (method git-fetch)
1208 (uri (git-reference
1209 (url "https://github.com/datalayer/jupyter-nbmodel-client")
1210 (commit (string-append "v" version))))
1211 (file-name (git-file-name name version))
1212 (sha256
1213 (base32 "0xbq23hnkd6vdyp0dvbm7bri0v5hgs3sqrl3a7cx8qdi8ws0jxlg"))))
1214 (build-system pyproject-build-system)
1215 (arguments
1216 ;; XXX: Most tests hang, find out why.
1217 (list #:tests? #f))
1218 (propagated-inputs
1219 (list python-jupyter-ydoc
1220 python-nbformat
1221 python-pycrdt
1222 python-requests
1223 python-websockets))
1224 (native-inputs
1225 (list python-hatchling
1226 python-hypercorn
1227 python-ipykernel
1228 python-jupyter-kernel-client
1229 python-jupyter-server-ydoc
1230 python-pycrdt-websocket
1231 python-pytest
1232 python-pytest-asyncio
1233 python-pytest-timeout))
1234 (home-page "https://github.com/datalayer/jupyter-nbmodel-client")
1235 (synopsis "Jupyter NbModel Client")
1236 (description "This package provides a Python library to interact with a
1237 live Jupyter Notebooks.")
1238 (license license:bsd-3)))
1239
1240(define-public python-jupyter-packaging
1241 (package
1242 (name "python-jupyter-packaging")
1243 (version "0.12.0")
1244 (source
1245 (origin
1246 (method url-fetch)
1247 (uri (pypi-uri "jupyter_packaging" version))
1248 (sha256
1249 (base32
1250 "1b7ssc627vgrdl21c09w9sxk5fc1ps3g7f70laxag4yw1bb5ax5j"))))
1251 (build-system pyproject-build-system)
1252 (arguments
1253 (list
1254 #:phases
1255 #~(modify-phases %standard-phases
1256 (add-before 'check 'configure-tests
1257 (lambda* (#:key tests? #:allow-other-keys)
1258 (when tests?
1259 ;; Disable isolation so that the package environment can be
1260 ;; setup without connectivity.
1261 (setenv "SOURCE_DATE_EPOCH" "315532800")
1262 (substitute* "tests/test_build_api.py"
1263 (("\"-m\", \"build\"" all)
1264 (string-append all ", \"--no-isolation\"")))))))))
1265 (propagated-inputs
1266 (list python-deprecation python-packaging python-setuptools
1267 python-tomlkit python-wheel))
1268 (native-inputs
1269 (list python-pypa-build
1270 python-pytest
1271 python-pytest-mock
1272 python-setuptools))
1273 (home-page "https://jupyter.org")
1274 (synopsis "Jupyter packaging utilities")
1275 (description "This package provides tools to help build and install
1276Jupyter Python packages that require a pre-build step that may include
1277JavaScript build steps.")
1278 (license license:bsd-3)))
1279
1280(define-public python-hatch-jupyter-builder
1281 (package
1282 (name "python-hatch-jupyter-builder")
1283 (version "0.9.1")
1284 (source
1285 (origin
1286 (method url-fetch)
1287 (uri (pypi-uri "hatch_jupyter_builder" version))
1288 (sha256
1289 (base32 "1baqk80c5ddhksh73l48mb59vvaaa2ldrs65k6vldii4s6c829vr"))))
1290 (build-system pyproject-build-system)
1291 (arguments
1292 ;; Don't attempt to build anything, because we don't have network access
1293 ;; anyway.
1294 (list #:test-flags '(list "-k" "not test_hatch_build")))
1295 (propagated-inputs (list python-hatchling))
1296 (native-inputs (list python-pytest
1297 python-pytest-mock
1298 python-tomli))
1299 (home-page "https://github.com/jupyterlab/hatch-jupyter-builder")
1300 (synopsis "Hatch plugin to help build Jupyter packages")
1301 (description
1302 "This package provides a hatch plugin to help build Jupyter packages.")
1303 (license license:bsd-3)))
1304
1305(define-public python-jupyter-server
1306 (package
1307 (name "python-jupyter-server")
1308 (version "2.17.0")
1309 (source
1310 (origin
1311 (method url-fetch)
1312 (uri (pypi-uri "jupyter_server" version))
1313 (sha256
1314 (base32
1315 "1mcrgqgzhwfiqk7x4lc2x294ba7cb3ny2akpnj4chr39ascai3n3"))))
1316 (build-system pyproject-build-system)
1317 (arguments
1318 (list
1319 #:test-flags
1320 ;; Integration tests require a server.
1321 '(list "-m" "not integration_test"
1322 ;; This test fails just like the shutil test in
1323 ;; python-jupyter-events fails. Odd, that.
1324 "-k" "not test_server_extension_list")
1325 #:phases
1326 #~(modify-phases %standard-phases
1327 (add-after 'unpack 'ignore-deprecation-warnings
1328 (lambda _
1329 (substitute* "pyproject.toml"
1330 ((" \"ignore:datetime.*" m)
1331 (string-append m "\n\"ignore:zmq.eventloop.ioloop is deprecated:DeprecationWarning\","
1332 "\n\"ignore:There is no current event loop:DeprecationWarning\","
1333 "\n\"ignore:unclosed event loop:ResourceWarning\","
1334 ;; From tornado
1335 "\n\"ignore:unclosed <socket.socket:ResourceWarning\",")))))
1336 (add-before 'check 'pre-check
1337 (lambda _
1338 (let ((home (string-append (getcwd) "/guix-home")))
1339 (setenv "HOME" home))
1340 ;; Add jupyter-server executable to PATH.
1341 (setenv "PATH"
1342 (string-append #$output "/bin:" (getenv "PATH"))))))))
1343 (propagated-inputs
1344 (list python-anyio
1345 python-argon2-cffi
1346 python-jinja2
1347 python-jupyter-client
1348 python-jupyter-core
1349 python-jupyter-events
1350 python-jupyter-server-terminals
1351 python-nbconvert
1352 python-nbformat
1353 python-overrides
1354 python-packaging
1355 python-prometheus-client
1356 python-pyzmq
1357 python-send2trash
1358 python-terminado
1359 python-tornado
1360 python-traitlets
1361 python-websocket-client))
1362 (native-inputs
1363 (list python-flaky
1364 python-hatchling
1365 python-hatch-jupyter-builder
1366 python-ipykernel
1367 python-pytest
1368 python-pytest-asyncio
1369 python-pytest-console-scripts
1370 python-pytest-jupyter
1371 python-pytest-timeout
1372 python-requests))
1373 (home-page "https://jupyter.org")
1374 (synopsis "Core services, APIs, and REST endpoints for Jupyter web applications")
1375 (description
1376 "This package provides the backend—i.e. core services, APIs, and REST
1377endpoints—to Jupyter web applications.")
1378 (license license:expat)))
1379
1380(define-public python-jupyter-server-client
1381 ;; No tags upstream for recent versions.
1382 (let ((commit "10b56e3effd72743a3b3b058908c6d07943a8aa7")
1383 (revision "0"))
1384 (package
1385 (name "python-jupyter-server-client")
1386 (version (git-version "0.1.1" revision commit))
1387 (source
1388 (origin
1389 (method git-fetch)
1390 (uri (git-reference
1391 (url "https://github.com/datalayer/jupyter-server-client")
1392 (commit commit)))
1393 (file-name (git-file-name name version))
1394 (sha256
1395 (base32 "1m9iqcr16h5zj04f91rmjjl3dyd52dmg8dk98275p2kq81a23769"))))
1396 (build-system pyproject-build-system)
1397 (arguments
1398 (list
1399 #:phases
1400 #~(modify-phases %standard-phases
1401 (add-after 'unpack 'disable-coverage
1402 (lambda _
1403 (substitute* "pyproject.toml"
1404 ((".*--cov.*") "")))))))
1405 (propagated-inputs
1406 (list python-pydantic
1407 python-requests))
1408 (native-inputs
1409 (list python-hatchling
1410 python-httpx
1411 python-pytest
1412 python-pytest-asyncio))
1413 (home-page "https://github.com/datalayer/jupyter-server-client")
1414 (synopsis "Client library to interact with Jupyter servers")
1415 (description "This package provides a Python library to interact with
1416Jupyter Server REST API for server management operations. It provides
1417server-level functionality including kernel listing (read-only) while avoiding
1418duplication with existing kernel management libraries.")
1419 (license license:bsd-3))))
1420
1421(define-public python-jupyter-server-fileid
1422 (package
1423 (name "python-jupyter-server-fileid")
1424 (version "0.9.3")
1425 (source
1426 (origin
1427 (method git-fetch)
1428 (uri (git-reference
1429 (url "https://github.com/jupyter-server/jupyter_server_fileid")
1430 (commit (string-append "v" version))))
1431 (file-name (git-file-name name version))
1432 (sha256
1433 (base32 "12hx3160anqcrzrj52k0lsh1nswj63lfzia33j1xc69vlngf3gm1"))))
1434 (build-system pyproject-build-system)
1435 (arguments
1436 (list
1437 #:phases
1438 #~(modify-phases %standard-phases
1439 (add-before 'check 'pre-check
1440 (lambda _
1441 (setenv "HOME" (dirname (getcwd))))))))
1442 (propagated-inputs
1443 (list python-jupyter-events
1444 python-jupyter-server))
1445 (native-inputs
1446 (list python-hatchling
1447 python-jupyter-server
1448 python-pytest
1449 python-pytest-jupyter))
1450 (home-page "https://github.com/jupyter-server/jupyter_server_fileid")
1451 (synopsis "File ID service extension for Jupyter Server")
1452 (description
1453 "This package provides a Jupyter Server extension with an implementation
1454of the File ID service.")
1455 (license license:bsd-3)))
1456
1457(define-public python-jupyter-server-terminals
1458 (package
1459 (name "python-jupyter-server-terminals")
1460 (version "0.5.4")
1461 (source
1462 (origin
1463 (method url-fetch)
1464 (uri (pypi-uri "jupyter_server_terminals" version))
1465 (sha256
1466 (base32 "1xc7zdhlfy8r2jgsrxfm7skm56dblkrg3ya90c1fj2qxsj715nmv"))))
1467 (build-system pyproject-build-system)
1468 ;; The tests require python-jupyter-server, but python-jupyter-server
1469 ;; needs this package.
1470 (arguments (list #:tests? #false))
1471 (propagated-inputs (list python-terminado))
1472 (native-inputs
1473 (list python-hatchling))
1474 (home-page "https://pypi.org/project/jupyter-server-terminals/")
1475 (synopsis "Jupyter Server extension providing terminals")
1476 (description
1477 "This package provides a Jupyter Server extension providing terminals.")
1478 (license license:bsd-3)))
1479
1480(define-public python-jupyterlab-widgets
1481 (package
1482 (name "python-jupyterlab-widgets")
1483 ;; XXX: Newer version requires python-jupyterlab, see guix/guix#2073.
1484 (version "3.0.12")
1485 (source
1486 (origin
1487 (method url-fetch)
1488 (uri (pypi-uri "jupyterlab_widgets" version))
1489 (sha256
1490 (base32 "1bi4ry8pfj27n3acm21vaq4iiq60i0ci4dqhcdr8li2zx3zc0fk2"))))
1491 (build-system pyproject-build-system)
1492 (arguments
1493 (list #:tests? #f)) ;no tests in PyPI
1494 (native-inputs
1495 (list python-jupyter-packaging))
1496 (home-page "https://github.com/jupyter-widgets/ipywidgets")
1497 (synopsis "Interactive widgets for Jupyter Notebooks")
1498 (description "ipywidgets, also known as jupyter-widgets or simply widgets,
1499are interactive HTML widgets for Jupyter notebooks and the IPython kernel.")
1500 (license license:bsd-3)))
1501
1502(define-public python-jupyterlite-core
1503 (package
1504 (name "python-jupyterlite-core")
1505 (version "0.1.3")
1506 (source
1507 (origin
1508 (method url-fetch)
1509 (uri (pypi-uri "jupyterlite_core" version))
1510 (sha256
1511 (base32 "18ysrqlsh7a31sknfnng419r7wpx9nfj59lxxd6zl1kcj6wazh34"))))
1512 (build-system pyproject-build-system)
1513 (propagated-inputs (list python-doit python-jupyter-core))
1514 (native-inputs (list python-ansi2html
1515 python-hatchling
1516 python-pytest
1517 python-pytest-console-scripts
1518 python-pytest-xdist
1519 python-tornado))
1520 (home-page "https://github.com/jupyterlite/jupyterlite")
1521 (synopsis "Core functionality for building JupyterLite websites")
1522 (description "The jupyterlite-core package provides the core functionality
1523for building JupyterLite websites, the jupyter-lite CLI, and extension points
1524for authoring custom addons.")
1525 (license license:bsd-3)))
1526
1527(define-public python-jupyterlite-sphinx
1528 (package
1529 (name "python-jupyterlite-sphinx")
1530 (version "0.9.3")
1531 (source
1532 (origin
1533 (method url-fetch)
1534 (uri (pypi-uri "jupyterlite_sphinx" version))
1535 (sha256
1536 (base32 "05h7zrvsx0xzxlddsqfz1fxdgld66yhn6nxfp4jz20wbx6csrr4v"))))
1537 (build-system pyproject-build-system)
1538 (arguments (list #:tests? #false)) ;there are none
1539 (propagated-inputs (list python-docutils python-jupyter-server
1540 python-jupyterlab-server python-jupyterlite-core
1541 python-sphinx))
1542 (native-inputs (list python-hatchling))
1543 (home-page "https://github.com/jupyterlite/jupyterlite")
1544 (synopsis "Sphinx extension for deploying JupyterLite")
1545 (description "This package provides a Sphinx extension for deploying
1546@code{JupyterLite}.")
1547 (license license:bsd-3)))
1548
1549(define-public python-jupyter-server-mathjax
1550 (package
1551 (name "python-jupyter-server-mathjax")
1552 (version "0.2.6")
1553 (source
1554 (origin
1555 (method url-fetch)
1556 (uri (pypi-uri "jupyter_server_mathjax" version))
1557 (sha256
1558 (base32 "0hrrl969r7ir6q683hlr7a4lid9x2s35hax2hviiyv38q1nnn7mv"))))
1559 (build-system pyproject-build-system)
1560 (arguments
1561 (list
1562 #:test-flags
1563 '(list "--pyargs" "jupyter_server_mathjax")))
1564 (propagated-inputs (list python-jupyter-server))
1565 (native-inputs
1566 (list python-jupyter-packaging
1567 python-pytest python-pytest-jupyter
1568 python-setuptools python-wheel))
1569 (home-page "https://jupyter.org")
1570 (synopsis "Jupyter Server extension for serving Mathjax")
1571 (description "This package provides a Jupyter Server extension for serving
1572Mathjax, the JavaScript display engine for mathematics.")
1573 (license license:bsd-3)))
1574
1575(define-public python-jupyter-server-ydoc
1576 (package
1577 (name "python-jupyter-server-ydoc")
1578 (version "2.3.0")
1579 (source
1580 (origin
1581 (method url-fetch)
1582 (uri (pypi-uri "jupyter_server_ydoc" version))
1583 (sha256
1584 (base32 "1g7yivy3mi4fph60rvffqgmg1kbjkgxnmwnd3x39ya4z3r4i3wrn"))))
1585 (build-system pyproject-build-system)
1586 (arguments
1587 (list
1588 #:test-flags
1589 #~(list "-k"
1590 (string-join
1591 ;; Those tests hang.
1592 (list "not test_get_document_"
1593 "test_room_handler_"
1594 "test_fork_handler"
1595 ;; ExceptionGroup assertion error.
1596 "test_dirty")
1597 " and not "))
1598 #:phases
1599 #~(modify-phases %standard-phases
1600 ;; Very insidious error cascading in dependent packages tests...
1601 (add-after 'unpack 'fix-events-version
1602 (lambda _
1603 (substitute* (find-files "jupyter_server_ydoc/events" "\\.yaml$")
1604 (("version: \"1\"") "version: 1"))))
1605 (add-before 'check 'pre-check
1606 (lambda _
1607 (setenv "HOME" (dirname (getcwd))))))))
1608 (propagated-inputs
1609 (list python-jsonschema
1610 python-jupyter-events
1611 python-jupyter-server
1612 python-jupyter-server-fileid
1613 python-jupyter-ydoc
1614 python-pycrdt
1615 python-pycrdt-websocket))
1616 (native-inputs
1617 (list nss-certs-for-test
1618 python-anyio
1619 python-dirty-equals
1620 python-hatchling
1621 python-httpx-ws
1622 python-importlib-metadata
1623 python-jupyter-server
1624 python-jupyter-server-fileid
1625 python-pytest
1626 python-pytest-jupyter))
1627 (home-page
1628 (string-append "https://github.com/jupyterlab/jupyter-collaboration"
1629 "/tree/main/projects/jupyter-server-ydoc"))
1630 (synopsis "Collaborative service extension for Jupyter Server")
1631 (description
1632 "This package provides a Jupyter Server extension integrating
1633collaborative shared models.")
1634 (license license:bsd-3)))
1635
1636(define-public python-jupyter-ydoc
1637 (package
1638 (name "python-jupyter-ydoc")
1639 (version "3.4.1")
1640 (source
1641 (origin
1642 (method git-fetch)
1643 (uri (git-reference
1644 (url "https://github.com/jupyter-server/jupyter_ydoc")
1645 (commit (string-append "v" version))))
1646 (file-name (git-file-name name version))
1647 (sha256
1648 (base32 "04k8dp4gklhnjwhkv5m3sxmlm2w229fn648v4rq2a7r2aqz14mhy"))))
1649 (build-system pyproject-build-system)
1650 (arguments
1651 (list
1652 #:test-flags
1653 ;; These tests require Node.
1654 #~(list "--deselect=tests/test_pycrdt_yjs.py::test_ypy_yjs_")
1655 #:phases
1656 #~(modify-phases %standard-phases
1657 (add-before 'check 'fix-tests
1658 (lambda _
1659 (substitute* "tests/conftest.py"
1660 (("^update_json_file.*" all)
1661 (string-append "# " all))))))))
1662 (propagated-inputs (list python-anyio python-pycrdt))
1663 (native-inputs
1664 (list python-hatch-nodejs-version
1665 python-hatchling
1666 python-hypercorn
1667 python-httpx-ws
1668 python-pycrdt
1669 python-pycrdt-websocket
1670 python-pytest))
1671 (home-page "https://jupyter.org")
1672 (synopsis "Document structures for collaborative editing using Yjs")
1673 (description
1674 "This package provides @code{python-pycrdt}-based data structures for
1675various documents used in the Jupyter ecosystem. Built-in documents include:
1676@itemize
1677@item YBlob: a generic immutable binary document.
1678@item YUnicode: a generic UTF8-encoded text document (YFile is an alias).
1679@item YNotebook: a Jupyter notebook document.
1680@end itemize")
1681 (license license:bsd-3)))
1682
1683(define-public python-comm
1684 (package
1685 (name "python-comm")
1686 (version "0.2.2")
1687 (source
1688 (origin
1689 (method git-fetch) ; no tests data in PyPi package
1690 (uri (git-reference
1691 (url "https://github.com/ipython/comm")
1692 (commit (string-append "v" version))))
1693 (file-name (git-file-name name version))
1694 (sha256
1695 (base32 "18xsbpd8dgcfbc51xl59nlwaq7jnyzvgzjfj6psscv71894x4lg7"))))
1696 (build-system pyproject-build-system)
1697 (native-inputs
1698 (list python-hatchling python-pytest python-setuptools-scm))
1699 (propagated-inputs
1700 (list python-traitlets))
1701 (home-page "https://github.com/ipython/comm")
1702 (synopsis "Python Comm implementation for the Jupyter kernel protocol")
1703 (description
1704 "This package provides a way to register a Kernel Comm implementation, as
1705per the Jupyter kernel protocol. It also provides a base Comm implementation
1706and a default CommManager that can be used.")
1707 (license license:bsd-3)))
1708
1709(define-public python-nbclient
1710 (package
1711 (name "python-nbclient")
1712 (version "0.10.0")
1713 (source
1714 (origin
1715 (method url-fetch)
1716 (uri (pypi-uri "nbclient" version))
1717 (sha256
1718 (base32
1719 "02dvb9ffpd237apyj4fw97a9371kv99lzny49624j7jkp9yingsb"))))
1720 (build-system pyproject-build-system)
1721 ;; Tests require tools from nbconvert, which would introduces a cycle.
1722 (arguments '(#:tests? #false))
1723 (propagated-inputs
1724 (list python-jupyter-client python-jupyter-core python-nbformat
1725 python-traitlets))
1726 (native-inputs
1727 (list python-hatchling
1728 python-flaky
1729 python-pytest
1730 python-pytest-asyncio
1731 python-testpath
1732 python-xmltodict))
1733 (home-page "https://jupyter.org")
1734 (synopsis "Client library for executing notebooks")
1735 (description
1736 "This package provides a client library for executing notebooks.
1737It was formerly known as nbconvert's @code{ExecutePreprocessor.}")
1738 (license license:bsd-3)))
1739
1740(define-public python-nbdime
1741 (package
1742 (name "python-nbdime")
1743 (version "4.0.2")
1744 (source
1745 (origin
1746 (method url-fetch)
1747 (uri (pypi-uri "nbdime" version))
1748 (sha256
1749 (base32 "1whvdz9i3c2f4fgy1mnvv0z88rxv6540rmi07cjhnv139f7ry9yq"))))
1750 (build-system pyproject-build-system)
1751 (arguments
1752 (list
1753 #:phases
1754 #~(modify-phases %standard-phases
1755 (add-before 'check 'pre-check
1756 (lambda _
1757 (setenv "HOME" "/tmp")
1758 (setenv "GIT_AUTHOR_NAME" "Your Name")
1759 (setenv "GIT_COMMITTER_NAME" "Your Name")
1760 (setenv "GIT_AUTHOR_EMAIL" "[email protected]")
1761 (setenv "GIT_COMMITTER_EMAIL" "[email protected]")
1762 (invoke "git" "init")
1763 (invoke "git" "config" "--global" "user.name" "Your Name")
1764 (invoke "git" "config" "--global" "user.email" "[email protected]"))))))
1765 (propagated-inputs
1766 (list python-colorama
1767 python-gitpython
1768 python-jinja2
1769 python-jupyter-server
1770 python-jupyter-server-mathjax
1771 python-nbformat
1772 python-pygments
1773 python-requests
1774 python-tornado))
1775 (native-inputs
1776 (list git-minimal/pinned
1777 python-hatch-jupyter-builder
1778 python-hatchling
1779 python-mock
1780 python-pytest
1781 python-pytest-tornado))
1782 (home-page "https://nbdime.readthedocs.io")
1783 (synopsis "Diff tools for Jupyter Notebooks")
1784 (description "@code{nbdime} provides tools for diffing and merging of
1785Jupyter Notebooks. It includes the following commands:
1786@table @command
1787@item nbdiff compare notebooks in a terminal-friendly way
1788@item nbmerge three-way merge of notebooks with automatic conflict resolution
1789@item nbdiff-web rich rendered diff of notebooks
1790@item nbmerge-web web-based three-way merge tool for notebooks
1791nbshow present a single notebook in a terminal-friendly way
1792@end table")
1793 (license license:bsd-3)))
1794
1795(define-public python-nbstripout
1796 (package
1797 (name "python-nbstripout")
1798 (version "0.8.1")
1799 (source (origin
1800 (method url-fetch)
1801 (uri (pypi-uri "nbstripout" version))
1802 (sha256
1803 (base32
1804 "1c8b4fz807qlh028yi35gahwbas4pbwc1wjx3vz8v7kj9rmqpb7a"))))
1805 (build-system pyproject-build-system)
1806 (arguments
1807 (list
1808 #:test-flags
1809 ;; These tests use git.
1810 '(list "--ignore=tests/test_git_integration.py"
1811 ;; These complain about missing files.
1812 "--ignore=tests/test_end_to_end.py")
1813 #:phases
1814 #~(modify-phases %standard-phases
1815 (add-before 'check 'set-CRAMSHELL
1816 (lambda _
1817 (setenv "CRAMSHELL" (which "bash")))))))
1818 (propagated-inputs (list python-nbformat))
1819 (native-inputs
1820 (list python-pytest python-setuptools python-wheel))
1821 (home-page "https://github.com/kynan/nbstripout")
1822 (synopsis "Strips outputs from Jupyter and IPython notebooks")
1823 (description
1824 "This package opens a notebook, strips its output, and writes the outputless
1825version to the original file.")
1826 (license license:expat)))
1827
1828(define-public repo2docker
1829 (package
1830 (name "repo2docker")
1831 (version "2024.07.0")
1832 (source (origin
1833 (method git-fetch)
1834 (uri (git-reference
1835 (url "https://github.com/jupyterhub/repo2docker/")
1836 (commit version)))
1837 (file-name (git-file-name name version))
1838 (sha256
1839 (base32
1840 "1fg71bldvfiln8h91sca4bjhwk7vdh80rhf0514qk6vqpikpx4cb"))))
1841 (outputs '("out" "doc"))
1842 (build-system pyproject-build-system)
1843 (arguments
1844 (list
1845 #:test-flags
1846 #~(list
1847 ;; XXX: Require external tools.
1848 "--ignore-glob=tests/base/node/*"
1849 "--ignore-glob=tests/conda/*"
1850 "--ignore-glob=tests/dockerfile/*"
1851 "--ignore-glob=tests/external/*"
1852 "--ignore=tests/unit/test_external_scripts.py"
1853 "--ignore-glob=tests/julia/*"
1854 "--ignore-glob=tests/nix/*"
1855 "--ignore-glob=tests/pipfile/*"
1856 "--ignore-glob=tests/r/*"
1857 "--ignore=tests/unit/test_r.py"
1858 "--ignore=tests/unit/test_app.py"
1859 "--ignore=tests/unit/test_clone_depth.py"
1860 "--ignore=tests/unit/test_labels.py"
1861 ;; XXX: Require network.
1862 "--ignore=tests/unit/test_connect_url.py"
1863 "--ignore-glob=tests/unit/contentproviders/*"
1864 ;; XXX: Require root.
1865 "--ignore=tests/unit/test_editable.py"
1866 "--ignore=tests/unit/test_ports.py"
1867 "--ignore=tests/unit/test_subdir.py"
1868 ;; XXX: Require a running docker service.
1869 "--deselect=tests/unit/test_env.py::test_env"
1870 "--deselect=tests/unit/test_users.py::test_user"
1871 "--deselect=tests/unit/test_volumes.py::test_volume_abspath"
1872 "--deselect=tests/unit/test_volumes.py::test_volume_relpath")
1873 #:phases
1874 #~(modify-phases %standard-phases
1875 (add-after 'patch-shebangs 'fix-install-miniforge
1876 (lambda _
1877 (substitute* (find-files
1878 #$output "^(install-miniforge|install-nix|\
1879nix-shell-wrapper|repo2docker-entrypoint)")
1880 (("^#!(.*)/bin/bash")
1881 "#!/bin/bash"))
1882 (substitute* (find-files #$output "^freeze\\.py$")
1883 (("^#!(.*)/bin/python3")
1884 "#!/bin/python3\n"))))
1885 (add-after 'install 'make-doc
1886 (lambda _
1887 (let ((doc (string-append #$output:out "/share/doc/"
1888 #$(package-name this-package))))
1889 (setenv "PYTHONPATH"
1890 (string-append (getcwd) ":"
1891 (getenv "GUIX_PYTHONPATH")))
1892 ;; Don't treat warnings as errors.
1893 (substitute* "docs/Makefile"
1894 (("(SPHINXOPTS[[:blank:]]+= )-W" _ group)
1895 group))
1896 (with-directory-excursion "docs"
1897 (invoke "make" "html")
1898 (copy-recursively "build/html"
1899 (string-append doc "/html"))))))
1900 (add-before 'check 'patch-bash-for-tests
1901 (lambda _
1902 (substitute* (find-files "tests/unit" "\\.py$")
1903 (("/bin/bash")
1904 (which "bash"))))))))
1905 (inputs
1906 (list python-traitlets
1907 python-toml
1908 python-semver
1909 python-ruamel.yaml
1910 python-requests
1911 python-json-logger
1912 python-jinja2
1913 python-iso8601
1914 python-escapism
1915 python-docker
1916 python-chardet))
1917 (native-inputs
1918 (list python-entrypoints
1919 python-myst-parser
1920 python-pydata-sphinx-theme
1921 python-pytest
1922 python-requests-mock
1923 python-recommonmark
1924 python-setuptools
1925 python-sphinx
1926 python-sphinx-copybutton
1927 python-sphinxcontrib-autoprogram
1928 python-sphinxext-opengraph
1929 python-sphinxext-rediraffe
1930 python-wheel))
1931 (home-page "https://repo2docker.readthedocs.io/en/latest/index.html#")
1932 (synopsis "Generate docker images from repositories")
1933 (description
1934 "repo2docker fetches a repository (from GitHub, GitLab, Zenodo, Figshare,
1935Dataverse installations, a Git repository or a local directory) and builds a
1936container image in which the code can be executed. The image build process is
1937based on the configuration files found in the repository. repo2docker can be
1938used to explore a repository locally by building and executing the constructed
1939image of the repository, or as a means of building images that are pushed to a
1940Docker registry.")
1941 (license license:bsd-3)))
1942
1943(define-public python-bash-kernel
1944 (package
1945 (name "python-bash-kernel")
1946 (version "0.10.0")
1947 (source
1948 (origin
1949 (method url-fetch)
1950 (uri (pypi-uri "bash_kernel" version))
1951 (sha256
1952 (base32 "1ji8bivxm1d6hx10rda4fhai57l8djyha5g7a7bx26642sja1m9f"))))
1953 (build-system pyproject-build-system)
1954 (arguments
1955 (list
1956 #:tests? #f ; No tests.
1957 #:phases
1958 #~(modify-phases %standard-phases
1959 (add-after 'unpack 'bash-references
1960 (lambda* (#:key inputs #:allow-other-keys)
1961 (let ((bash (search-input-file inputs "bin/bash")))
1962 (substitute* "bash_kernel/kernel.py"
1963 (("\"bash\"")
1964 (format #f "~s" bash))
1965 (("\\['bash', ")
1966 (format #f "['~a', " bash))))))
1967 (add-after 'install 'install-kernelspec
1968 (lambda _
1969 (setenv "HOME" "/tmp")
1970 (invoke "python" "-m" "bash_kernel.install"
1971 "--prefix" #$output))))))
1972 (native-inputs (list python-flit-core))
1973 (inputs
1974 (list bash)) ;must be bash with readline
1975 (propagated-inputs
1976 (list python-filetype
1977 python-ipykernel
1978 python-jupyter-client
1979 python-pexpect))
1980 (home-page "https://github.com/takluyver/bash_kernel")
1981 (synopsis "Jupyter kernel for Bash")
1982 (description "A bash shell kernel for Jupyter.")
1983 (license license:expat)))
1984
1985(define-public python-ipydatawidgets
1986 (package
1987 (name "python-ipydatawidgets")
1988 (version "4.2.0")
1989 (source
1990 (origin
1991 (method url-fetch)
1992 (uri (pypi-uri "ipydatawidgets" version))
1993 (sha256
1994 (base32 "1g65nzlsb1cipmvh9v27b22kkmzwvg8zbf32hmg1c25mb65vbr6h"))))
1995 (build-system pyproject-build-system)
1996 (arguments
1997 (list
1998 ;; tests: 87 passed, 9 deselected, 12 warnings
1999 #:test-flags
2000 #~(list ;; Disable failing tests.
2001 "--ignore=examples/test.ipynb"
2002 "-k" (string-append
2003 "not test_dataunion_constricts_widget_data"
2004 " and not test_dataunion_widget_change_notified"
2005 " and not test_datawidget_creation_blank_comm"
2006 ;; TODO: type object 'Widget' has no attribute '_ipython_display_'
2007 " and not test_notification"
2008 " and not test_manual_notification"
2009 " and not test_sync_segment"
2010 " and not test_hold_sync"
2011 " and not test_hold_sync_segment"
2012 ;; OverflowError: Python integer -33 out of bounds for uint8
2013 " and not test_dtype_coerce"))
2014 ;; XXX: Missing files when running bdist_wheel.
2015 #:phases
2016 #~(modify-phases %standard-phases
2017 (replace 'build
2018 (lambda _
2019 (invoke "python" "setup.py" "build")))
2020 (replace 'install
2021 (lambda _
2022 (invoke "python" "setup.py" "install"
2023 (string-append "--prefix=" #$output)))))))
2024 (propagated-inputs
2025 (list python-ipython-genutils
2026 python-ipywidgets
2027 python-numpy
2028 python-traittypes))
2029 (native-inputs
2030 (list python-jupyter-packaging
2031 python-nbval
2032 python-pytest
2033 python-setuptools))
2034 (home-page "https://github.com/vidartf/ipydatawidgets")
2035 (synopsis "Widgets to help facilitate reuse of large datasets across widgets")
2036 (description
2037 "This package provides a set of widgets to help facilitate reuse of large
2038datasets across widgets.")
2039 (license license:bsd-3)))
2040
2041(define-public python-papermill
2042 (package
2043 (name "python-papermill")
2044 (version "2.7.0")
2045 (source
2046 (origin
2047 (method git-fetch)
2048 (uri (git-reference
2049 (url "https://github.com/nteract/papermill")
2050 (commit version)))
2051 (file-name (git-file-name name version))
2052 (sha256
2053 (base32 "0lafh4lazx4rc3ly746bjflmihkzf9rhp788bni1l4vq12ks6a49"))))
2054 (build-system pyproject-build-system)
2055 (arguments
2056 (list
2057 ;; tests: 503 passed, 2 deselected, 226 warnings
2058 #:test-flags
2059 ;; Do not bother testing Azure, AWS, and Google Cloud features.
2060 #~(list "--ignore=papermill/tests/test_abs.py"
2061 "--ignore=papermill/tests/test_adl.py"
2062 "--ignore=papermill/tests/test_gcs.py"
2063 "--ignore=papermill/tests/test_s3.py"
2064 #$@(map (lambda (ls)
2065 (string-append "--deselect=papermill/tests/"
2066 (string-join ls "::")))
2067 ;; AssertionError: 'error' != 'display_data'
2068 '(("test_execute.py" "TestBrokenNotebook2" "test")
2069 ;; NameError: name 'FileSelector' is not defined
2070 ("test_hdfs.py" "HDFSTest" "test_hdfs_listdir"))))))
2071 (propagated-inputs (list python-aiohttp
2072 python-click
2073 python-entrypoints
2074 python-nbclient
2075 python-nbformat
2076 python-pyyaml
2077 python-requests
2078 python-tenacity
2079 python-tqdm))
2080 (native-inputs (list python-attrs
2081 python-notebook
2082 python-pytest
2083 python-pytest-env
2084 python-pytest-mock
2085 python-recommonmark
2086 python-setuptools))
2087 (home-page "https://github.com/nteract/papermill")
2088 (synopsis "Parameterize and run Jupyter and nteract Notebooks")
2089 (description "Papermill is a tool for parameterizing, executing, and
2090analyzing Jupyter Notebooks.")
2091 (license license:bsd-3)))
2092
2093(define-public python-qtconsole
2094 (package
2095 (name "python-qtconsole")
2096 (version "5.7.2")
2097 (source
2098 (origin
2099 (method url-fetch)
2100 (uri (pypi-uri "qtconsole" version))
2101 (sha256
2102 (base32 "088m56fav6xlcw55srxz96yf7rj2ndmycy4f3m69498r2swqbd17"))))
2103 (build-system pyproject-build-system)
2104 (arguments
2105 (list
2106 #:test-flags
2107 ;; See: <https://github.com/spyder-ide/qtconsole/issues/582>.
2108 #~(list "--ignore=qtconsole/tests/test_jupyter_widget.py")
2109 #:phases
2110 #~(modify-phases %standard-phases
2111 (add-before 'check 'pre-check
2112 (lambda _
2113 (setenv "PYTEST_QT_API" "pyqt6")
2114 (setenv "QT_LIB" "pyqt6")
2115 (setenv "QT_QPA_PLATFORM" "offscreen")
2116 (system "Xvfb :1 -screen 0 640x480x24 &")
2117 (setenv "DISPLAY" ":1")
2118 (setenv "HOME" "/tmp"))))))
2119 (native-inputs
2120 (list python-flaky
2121 python-pyqt-6
2122 python-pytest
2123 python-pytest-asyncio
2124 python-pytest-qt
2125 python-setuptools
2126 xorg-server-for-tests))
2127 (propagated-inputs
2128 (list python-ipykernel
2129 python-ipython-pygments-lexers
2130 python-jupyter-client
2131 python-jupyter-core
2132 python-packaging
2133 python-pygments
2134 python-qtpy
2135 python-traitlets))
2136 (home-page "https://jupyter.org")
2137 (synopsis "Jupyter Qt console")
2138 (description
2139 "This package provides a Qt-based console for Jupyter with support for
2140rich media output.")
2141 (license license:bsd-3)))
2142
2143(define-public python-spyder-kernels
2144 (package
2145 (name "python-spyder-kernels")
2146 (version "3.1.6")
2147 (source
2148 (origin
2149 (method git-fetch)
2150 (uri (git-reference
2151 (url "https://github.com/spyder-ide/spyder-kernels")
2152 (commit (string-append "v" version))))
2153 (file-name (git-file-name name version))
2154 (sha256
2155 (base32 "02z1p6ivc01hqz6jimw8skpd7vvdfx98mrzlqkr6knjmhkp66m42"))))
2156 (build-system pyproject-build-system)
2157 (arguments
2158 (list
2159 #:test-flags
2160 #~(list "-k" (string-append
2161 ;; Avoid pulling Django for a single test.
2162 "not test_django_settings"
2163 ;; AssertionError.
2164 " and not test_umr_reload_modules"))
2165 #:phases
2166 #~(modify-phases %standard-phases
2167 (add-before 'check 'redirect-HOME
2168 (lambda _
2169 (setenv "HOME" "/tmp"))))))
2170 (propagated-inputs (list python-cloudpickle
2171 python-ipykernel
2172 python-ipython
2173 python-jupyter-client
2174 python-packaging
2175 python-pyxdg
2176 python-pyzmq
2177 python-traitlets
2178 python-wurlitzer))
2179 (native-inputs (list python-anyio
2180 python-cython
2181 python-dask
2182 python-h5py
2183 python-matplotlib
2184 python-numpy
2185 python-pandas
2186 python-pillow
2187 python-polars
2188 python-pyarrow
2189 python-pydicom
2190 python-pytest
2191 python-scipy
2192 python-setuptools
2193 python-xarray))
2194 (home-page "https://github.com/spyder-ide/spyder-kernels")
2195 (synopsis "Jupyter kernels for Spyder's console")
2196 (description "This package provides Jupyter kernels for use with the
2197consoles of Spyder, the Scientific Python Development Environment.
2198
2199These kernels can be launched either through Spyder itself or in an
2200independent Python session, and allow for interactive or file-based execution
2201of Python code inside Spyder.")
2202 (license license:expat)))
2203
2204(define-public python-voila
2205 (package
2206 (name "python-voila")
2207 (version "0.5.8")
2208 (source
2209 (origin
2210 (method git-fetch) ;no tests in pypi archive
2211 (uri (git-reference
2212 (url "https://github.com/voila-dashboards/voila")
2213 (commit (string-append "v" version))))
2214 (file-name (git-file-name name version))
2215 (sha256
2216 (base32
2217 "1fxw7m03iqd4bj1075mx6bspl48nj1rddi4mbs9jkziadc5yv7in"))))
2218 (build-system pyproject-build-system)
2219 (arguments
2220 (list
2221 ;; Many tests depend on Node JavaScript dependencies and a running HTTP
2222 ;; server; ignore them.
2223 #:test-flags
2224 '(list "--ignore" "tests/app"
2225 "--ignore" "tests/server"
2226 ;; No python3 jupyter kernel in the build environment.
2227 "-k" "not test_execute_output")
2228 #:phases
2229 #~(modify-phases %standard-phases
2230 (add-after 'unpack 'prepare-css
2231 (lambda* (#:key inputs #:allow-other-keys)
2232 ;; FIXME: we skip the build of the JavaScript extension. We
2233 ;; hadn't built it in previous versions, because we could easily
2234 ;; get away with it, but in this version we have to patch the
2235 ;; build system.
2236 (substitute* "pyproject.toml"
2237 (("\"voila/labextensions/jupyterlab-preview/static/style.js\",") "")
2238 (("\"share/jupyter/voila/themes/@jupyterlab/theme-dark-extension/index.css\"") ""))
2239 (copy-file (assoc-ref inputs "variables.css")
2240 "share/jupyter/voila/templates/base/static/labvariables.css")
2241 (copy-file (assoc-ref inputs "materialcolors.css")
2242 "share/jupyter/voila/templates/base/static/materialcolors.css")))
2243 ;; FIXME: This is likely wrong. The official wheel has very
2244 ;; different contents, which must be the result of actually running
2245 ;; jlpm and building the JavaScript packages.
2246 (add-after 'install 'install-extensions
2247 (lambda* (#:key inputs #:allow-other-keys)
2248 (let ((dir (string-append #$output
2249 "/share/jupyter/voila/labextensions/"
2250 "@voila-dashboards/widgets-manager7")))
2251 (mkdir-p dir)
2252 (invoke "tar" "xf"
2253 (assoc-ref inputs
2254 (string-append "voila-dashboards-widgets-manager7-"
2255 #$version ".tgz"))
2256 "--strip-components=1" "-C" dir))
2257 (let ((dir (string-append #$output
2258 "/share/jupyter/voila/labextensions/"
2259 "@voila-dashboards/widgets-manager8")))
2260 (mkdir-p dir)
2261 (invoke "tar" "xf"
2262 (assoc-ref inputs
2263 (string-append "voila-dashboards-widgets-manager8-"
2264 #$version ".tgz"))
2265 "--strip-components=1" "-C" dir))
2266 (let ((dir (string-append #$output
2267 "/share/jupyter/voila/labextensions/"
2268 "@voila-dashboards/jupyterlab-preview")))
2269 (mkdir-p dir)
2270 (invoke "tar" "xf"
2271 (assoc-ref inputs
2272 "voila-dashboards-jupyterlab-preview-2.3.8.tgz")
2273 "--strip-components=1" "-C" dir))))
2274 (add-before 'check 'set-HOME
2275 (lambda _ (setenv "HOME" "/tmp"))))))
2276 (propagated-inputs
2277 (list python-jupyter-client
2278 python-jupyter-server
2279 python-jupyterlab-server
2280 python-nbclient
2281 python-nbconvert
2282 python-traitlets
2283 python-websockets))
2284 (native-inputs
2285 (list python-hatchling
2286 python-hatch-jupyter-builder
2287 python-ipywidgets
2288 python-matplotlib
2289 python-mock
2290 python-numpy
2291 python-pandas
2292 python-pytest
2293 python-pytest-tornasync
2294 python-tornado
2295 (origin
2296 (method url-fetch)
2297 (uri "https://unpkg.com/@jupyterlab/[email protected]/style/materialcolors.css")
2298 (sha256
2299 (base32
2300 "1kvb24r3hbhmjdiip09w9pgzv6xmjzndch279r3ppf7rkgdcgirs")))
2301 (origin
2302 (method url-fetch)
2303 (uri "https://unpkg.com/@jupyterlab/[email protected]/style/variables.css")
2304 (sha256
2305 (base32
2306 "1mq6pr8w1r4jb2jgav15kkmjbca0x3nfsdv7q40xai994gsw5ygi")))
2307 (origin
2308 (method url-fetch)
2309 (uri (string-append
2310 "https://github.com/voila-dashboards/voila/releases/download/v"
2311 version "/voila-dashboards-widgets-manager7-" version ".tgz"))
2312 (sha256
2313 (base32
2314 "14fzn89nd6fnixzsy8jhz1y40z82msj5n44242zsjfxhlq8203rm")))
2315 (origin
2316 (method url-fetch)
2317 (uri (string-append
2318 "https://github.com/voila-dashboards/voila/releases/download/v"
2319 version "/voila-dashboards-widgets-manager8-" version ".tgz"))
2320 (sha256
2321 (base32
2322 "09kdrzpiw5psdq0ybrmmav1bwbli9gb4bdg0507069sipkap1nh4")))
2323 ;; FIXME: we are not yet using this release tarball.
2324 (origin
2325 (method url-fetch)
2326 (uri (string-append
2327 "https://github.com/voila-dashboards/voila/releases/download/v"
2328 version "/voila-dashboards-jupyterlab-preview-2.3.8.tgz"))
2329 (sha256
2330 (base32
2331 "1bj2v03183aksn0qcqvb6p6kh8p992pk0zyz1x4s2xpijyh0fxpm")))))
2332 (home-page "https://github.com/voila-dashboards/voila")
2333 (synopsis "Render live Jupyter notebooks with interactive widgets")
2334 (description
2335 "Voilà turns Jupyter notebooks into standalone web applications. Unlike
2336the usual HTML-converted notebooks, each user connecting to the Voilà tornado
2337application gets a dedicated Jupyter kernel which can execute the callbacks to
2338changes in Jupyter interactive widgets.")
2339 (license license:bsd-3)))