jupyter.scm 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages jupyter)
  21. #:use-module ((guix licenses) #:prefix license:)
  22. #:use-module (guix packages)
  23. #:use-module (guix download)
  24. #:use-module (guix git-download)
  25. #:use-module (guix build-system cmake)
  26. #:use-module (guix build-system python)
  27. #:use-module (gnu packages bash)
  28. #:use-module (gnu packages check)
  29. #:use-module (gnu packages cpp)
  30. #:use-module (gnu packages linux)
  31. #:use-module (gnu packages monitoring)
  32. #:use-module (gnu packages networking)
  33. #:use-module (gnu packages pkg-config)
  34. #:use-module (gnu packages python)
  35. #:use-module (gnu packages python-build)
  36. #:use-module (gnu packages python-check)
  37. #:use-module (gnu packages python-crypto)
  38. #:use-module (gnu packages python-xyz)
  39. #:use-module (gnu packages python-web)
  40. #:use-module (gnu packages rdf)
  41. #:use-module (gnu packages time)
  42. #:use-module (gnu packages xml)
  43. #:use-module (gnu packages tls)
  44. #:use-module (gnu packages sphinx)
  45. #:use-module (gnu packages serialization)
  46. #:use-module (gnu packages docker))
  47. (define-public python-jupyter-protocol
  48. (package
  49. (name "python-jupyter-protocol")
  50. (version "0.1.1")
  51. (source (origin
  52. (method url-fetch)
  53. (uri (pypi-uri "jupyter_protocol" version))
  54. (sha256
  55. (base32
  56. "1bk3as5yw9y5nmq6l15nr46aby34phmvsx9kxgqnm5pd5q2b5h57"))))
  57. (build-system python-build-system)
  58. (propagated-inputs
  59. `(("python-dateutil" ,python-dateutil)
  60. ("python-jupyter-core" ,python-jupyter-core)
  61. ("python-pyzmq" ,python-pyzmq)
  62. ("python-traitlets" ,python-traitlets)))
  63. (native-inputs
  64. `(("python-ipykernel" ,python-ipykernel)
  65. ("python-ipython" ,python-ipython)
  66. ("python-mock" ,python-mock)
  67. ("python-pytest" ,python-pytest)))
  68. (home-page "https://jupyter.org")
  69. (synopsis "Jupyter protocol implementation")
  70. (description
  71. "This Python library is an experimental implementation of the
  72. @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
  73. protocol} to be used by both clients and kernels.")
  74. (license license:bsd-3)
  75. (properties '((upstream-name . "jupyter_protocol")))))
  76. (define-public python-jupyter-kernel-mgmt
  77. (package
  78. (name "python-jupyter-kernel-mgmt")
  79. (version "0.4.0")
  80. (source (origin
  81. (method url-fetch)
  82. (uri (pypi-uri "jupyter_kernel_mgmt" version))
  83. (sha256
  84. (base32
  85. "0i7a78dn89ca8h0a42giyxwcmk6y4wrdr7q8h2ax9vybb84c795q"))))
  86. (build-system python-build-system)
  87. (propagated-inputs
  88. `(("python-dateutil" ,python-dateutil)
  89. ("python-entrypoints" ,python-entrypoints)
  90. ("python-jupyter-core" ,python-jupyter-core)
  91. ("python-jupyter-protocol" ,python-jupyter-protocol)
  92. ("python-pyzmq" ,python-pyzmq)
  93. ("python-traitlets" ,python-traitlets)))
  94. (native-inputs
  95. `(("python-ipykernel" ,python-ipykernel)
  96. ("python-ipython" ,python-ipython)
  97. ("python-mock" ,python-mock)
  98. ("python-pytest" ,python-pytest)))
  99. (home-page "https://jupyter.org")
  100. (synopsis "Discover, launch, and communicate with Jupyter kernels")
  101. (description
  102. "This package is an experimental refactoring of the machinery for
  103. launching and using Jupyter kernels.")
  104. (license license:bsd-3)
  105. (properties '((upstream-name . "jupyter_kernel_mgmt")))))
  106. (define-public python-jupyter-kernel-test
  107. (package
  108. (name "python-jupyter-kernel-test")
  109. (version "0.3")
  110. (home-page "https://github.com/jupyter/jupyter_kernel_test")
  111. (source (origin
  112. ;; PyPI has a ".whl" file but not a proper source release.
  113. ;; Thus, fetch code from Git.
  114. (method git-fetch)
  115. (uri (git-reference (url home-page) (commit version)))
  116. (file-name (git-file-name name version))
  117. (sha256
  118. (base32
  119. "00iy74i4i8is6axb9vlsm0b9wxkvyyxnbl8r0i4gaj3xd788jm83"))))
  120. (build-system python-build-system)
  121. (arguments
  122. ;; The repo doesn't contain a "setup.py" file so install files manually.
  123. '(#:phases (modify-phases %standard-phases
  124. (delete 'build)
  125. (delete 'check)
  126. (replace 'install
  127. (lambda* (#:key inputs outputs #:allow-other-keys)
  128. (let* ((out (assoc-ref outputs "out"))
  129. (version (python-version (assoc-ref inputs "python")))
  130. (pydir (string-append out "/lib/python"
  131. version "/site-packages/"
  132. "jupyter_kernel_test")))
  133. (for-each (lambda (file)
  134. (install-file file pydir))
  135. (find-files "jupyter_kernel_test"
  136. "\\.py$"))
  137. #t))))))
  138. (propagated-inputs
  139. `(("python-jupyter-kernel-mgmt" ,python-jupyter-kernel-mgmt)
  140. ("python-jupyter-protocol" ,python-jupyter-protocol)
  141. ("python-jsonschema" ,python-jsonschema)))
  142. (synopsis "Test Jupyter kernels")
  143. (description
  144. "@code{jupyter_kernel_test} is a tool for testing Jupyter kernels. It
  145. tests kernels for successful code execution and conformance with the
  146. @uref{https://jupyter-client.readthedocs.io/en/latest/messaging.html, Jupyter
  147. Messaging Protocol}.")
  148. (license license:bsd-3)))
  149. (define-public xeus
  150. (package
  151. (name "xeus")
  152. (version "0.23.2")
  153. (source (origin
  154. (method git-fetch)
  155. (uri (git-reference
  156. (url "https://github.com/QuantStack/xeus")
  157. (commit version)))
  158. (sha256
  159. (base32
  160. "1m1b6z1538r7mv2ggn7bdbd9570ja7cadplq64zl8rgl2c8vdi2a"))
  161. (file-name (git-file-name name version))))
  162. (build-system cmake-build-system)
  163. (arguments
  164. '(#:configure-flags '("-DBUILD_STATIC_LIBS=OFF"
  165. "-DDISABLE_ARCH_NATIVE=ON" ;no '-march=native'
  166. "-DBUILD_TESTING=ON")))
  167. (native-inputs
  168. `(("pkg-config" ,pkg-config)
  169. ;; The following inputs are used by the test suite.
  170. ("googletest" ,googletest)
  171. ("python-pytest" ,python-pytest)
  172. ("python" ,python-3)
  173. ("python-jupyter-kernel-test" ,python-jupyter-kernel-test)
  174. ("python-jupyter-client" ,python-jupyter-client)))
  175. (inputs
  176. `(("xtl" ,xtl)
  177. ("json-modern-cxx" ,json-modern-cxx)
  178. ("cppzmq" ,cppzmq)
  179. ("zeromq" ,zeromq)
  180. ("openssl" ,openssl)
  181. ("util-linux" ,util-linux "lib"))) ;libuuid
  182. (home-page "https://quantstack.net/xeus")
  183. (synopsis "C++ implementation of the Jupyter Kernel protocol")
  184. (description
  185. "@code{xeus} is a library meant to facilitate the implementation of
  186. kernels for Jupyter. It takes the burden of implementing the Jupyter Kernel
  187. protocol so developers can focus on implementing the interpreter part of the
  188. kernel.
  189. Several Jupyter kernels are built upon @code{xeus}, such as @code{xeus-cling},
  190. a kernel for the C++ programming language, and @code{xeus-python}, an
  191. alternative Python kernel for Jupyter.")
  192. (license license:bsd-3)))
  193. (define-public python-jupyterlab-pygments
  194. (package
  195. (name "python-jupyterlab-pygments")
  196. (version "0.1.2")
  197. (source
  198. (origin
  199. (method url-fetch)
  200. (uri (pypi-uri "jupyterlab_pygments" version))
  201. (sha256
  202. (base32
  203. "0ij14mmnc39nmf84i0av6j9glazjic7wzv1qyhr0j5966s3s1kfg"))))
  204. (build-system python-build-system)
  205. (arguments '(#:tests? #false)) ; there are no tests
  206. (propagated-inputs
  207. `(("python-pygments" ,python-pygments)))
  208. (home-page "https://jupyter.org")
  209. (synopsis "Pygments theme using JupyterLab CSS variables")
  210. (description
  211. "This package contains a syntax coloring theme for pygments making use of
  212. the JupyterLab CSS variables.")
  213. (license license:bsd-3)))
  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. (define-public python-jupyter-server
  245. (package
  246. (name "python-jupyter-server")
  247. (version "1.10.2")
  248. (source
  249. (origin
  250. (method url-fetch)
  251. (uri (pypi-uri "jupyter_server" version))
  252. (sha256
  253. (base32
  254. "1gvjbsw5nl94hz02rnkr4g4kkvh9fz7i45vz17hzwyvdpj7bd8yk"))))
  255. (build-system python-build-system)
  256. (arguments
  257. `(#:phases
  258. (modify-phases %standard-phases
  259. (replace 'check
  260. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  261. (when tests?
  262. (add-installed-pythonpath inputs outputs)
  263. (let ((home (string-append (getcwd) "/guix-home")))
  264. (setenv "HOME" home))
  265. ;; Add jupyter-server executable to PATH.
  266. (setenv "PATH"
  267. (string-append (assoc-ref outputs "out") "/bin:"
  268. (getenv "PATH")))
  269. (with-directory-excursion "jupyter_server"
  270. ;; The pytest fixtures are only loaded when the file is
  271. ;; called conftest.py.
  272. (rename-file "pytest_plugin.py" "conftest.py")
  273. (invoke "pytest" "-vv"
  274. ;; Fails with internal server error
  275. "-k" "not test_list_formats"
  276. ;; Integration tests require a server.
  277. "-m" "not integration_test"))))))))
  278. (propagated-inputs
  279. `(("python-anyio" ,python-anyio)
  280. ("python-argon2-cffi" ,python-argon2-cffi)
  281. ("python-ipython-genutils" ,python-ipython-genutils)
  282. ("python-jinja2" ,python-jinja2)
  283. ("python-jupyter-client" ,python-jupyter-client)
  284. ("python-jupyter-core" ,python-jupyter-core)
  285. ("python-nbconvert" ,python-nbconvert)
  286. ("python-nbformat" ,python-nbformat)
  287. ("python-prometheus-client" ,python-prometheus-client)
  288. ("python-pyzmq" ,python-pyzmq)
  289. ("python-requests-unixsocket" ,python-requests-unixsocket)
  290. ("python-send2trash" ,python-send2trash)
  291. ("python-terminado" ,python-terminado)
  292. ("python-tornado" ,python-tornado-6)
  293. ("python-traitlets" ,python-traitlets)
  294. ("python-websocket-client" ,python-websocket-client)))
  295. (native-inputs
  296. `(("python-coverage" ,python-coverage)
  297. ("python-ipykernel" ,python-ipykernel)
  298. ("python-pytest" ,python-pytest)
  299. ("python-pytest-console-scripts" ,python-pytest-console-scripts)
  300. ("python-pytest-cov" ,python-pytest-cov)
  301. ("python-pytest-mock" ,python-pytest-mock)
  302. ("python-pytest-tornasync" ,python-pytest-tornasync)
  303. ("python-requests" ,python-requests)))
  304. (home-page "https://jupyter.org")
  305. (synopsis "Core services, APIs, and REST endpoints for Jupyter web applications")
  306. (description
  307. "This package provides the backend—i.e. core services, APIs, and REST
  308. endpoints—to Jupyter web applications.")
  309. (license license:expat)))
  310. (define-public python-jupyterlab-widgets
  311. (package
  312. (name "python-jupyterlab-widgets")
  313. (version "1.0.0")
  314. (source
  315. (origin
  316. (method url-fetch)
  317. (uri (pypi-uri "jupyterlab_widgets" version))
  318. (sha256
  319. (base32
  320. "0y7vhhas3qndiypcpcfnhrj9n92v2w4hdc86nn620s9h9nl2j6jw"))))
  321. (build-system python-build-system)
  322. (native-inputs
  323. `(("python-jupyter-packaging" ,python-jupyter-packaging)
  324. ("python-setuptools" ,python-setuptools)))
  325. (home-page "https://github.com/jupyter-widgets/ipywidgets")
  326. (synopsis "Interactive widgets for Jupyter Notebooks")
  327. (description "ipywidgets, also known as jupyter-widgets or simply widgets,
  328. are interactive HTML widgets for Jupyter notebooks and the IPython kernel.")
  329. (license license:bsd-3)))
  330. (define-public python-nbclient
  331. (package
  332. (name "python-nbclient")
  333. (version "0.5.3")
  334. (source
  335. (origin
  336. (method url-fetch)
  337. (uri (pypi-uri "nbclient" version))
  338. (sha256
  339. (base32
  340. "172q4r6mq0lg394di0pc6ipvniy14jg38wkdsj48r366609jf5yv"))))
  341. (build-system python-build-system)
  342. ;; Tests require a kernel via python-ipykernel, and also tools from
  343. ;; nbconvert.
  344. (arguments '(#:tests? #false))
  345. (propagated-inputs
  346. `(("python-async-generator" ,python-async-generator)
  347. ("python-jupyter-client" ,python-jupyter-client)
  348. ("python-nbformat" ,python-nbformat)
  349. ("python-nest-asyncio" ,python-nest-asyncio)
  350. ("python-traitlets" ,python-traitlets)))
  351. (native-inputs
  352. `(("python-black" ,python-black)
  353. ("python-bumpversion" ,python-bumpversion)
  354. ("python-check-manifest" ,python-check-manifest)
  355. ("python-codecov" ,python-codecov)
  356. ("python-coverage" ,python-coverage)
  357. ("python-flake8" ,python-flake8)
  358. ;; ("python-ipykernel" ,python-ipykernel)
  359. ;; ("python-ipython" ,python-ipython)
  360. ;; ("python-ipywidgets" ,python-ipywidgets)
  361. ("python-mypy" ,python-mypy)
  362. ("python-pip" ,python-pip)
  363. ("python-pytest" ,python-pytest)
  364. ("python-pytest-cov" ,python-pytest-cov)
  365. ("python-setuptools" ,python-setuptools)
  366. ("python-testpath" ,python-testpath)
  367. ("python-tox" ,python-tox)
  368. ("python-twine" ,python-twine)
  369. ("python-wheel" ,python-wheel)
  370. ("python-xmltodict" ,python-xmltodict)))
  371. (home-page "https://jupyter.org")
  372. (synopsis "Client library for executing notebooks")
  373. (description
  374. "This package provides a client library for executing notebooks. Formerly
  375. nbconvert's @code{ExecutePreprocessor.}")
  376. (license license:bsd-3)))
  377. (define-public repo2docker
  378. (package
  379. (name "repo2docker")
  380. (version "2021.03.0")
  381. (source (origin
  382. (method git-fetch)
  383. (uri (git-reference
  384. (url "https://github.com/jupyterhub/repo2docker/")
  385. (commit "2021.03.0")))
  386. (file-name (git-file-name name version))
  387. (sha256
  388. (base32
  389. "18w8rgf7fpf79kx36y2c3xi3d52i41z112l3sz719d8kg0bir16m"))))
  390. (outputs '("out" "doc"))
  391. (build-system python-build-system)
  392. (arguments
  393. `(#:phases (modify-phases %standard-phases
  394. (add-after 'patch-shebangs 'fix-install-miniforge
  395. (lambda* (#:key outputs #:allow-other-keys)
  396. (let* ((out (assoc-ref outputs "out")))
  397. (substitute* (find-files
  398. out "^(install-miniforge|install-nix|\
  399. nix-shell-wrapper|repo2docker-entrypoint)")
  400. (("^#!(.*)/bin/bash")
  401. "#!/bin/bash"))
  402. (substitute* (find-files out "^freeze\\.py$")
  403. (("^#!(.*)/bin/python3")
  404. "#!/bin/python3\n")))))
  405. (add-after 'install 'make-doc
  406. (lambda* (#:key outputs #:allow-other-keys)
  407. (let* ((out (assoc-ref outputs "doc"))
  408. (doc (string-append out "/share/doc/"
  409. ,name)))
  410. (setenv "PYTHONPATH"
  411. (string-append (getcwd) ":"
  412. (getenv "PYTHONPATH")))
  413. (with-directory-excursion "docs"
  414. (invoke "make" "html")
  415. (copy-recursively "build/html"
  416. (string-append doc "/html")))))))))
  417. (inputs
  418. `(("python-traitlets" ,python-traitlets)
  419. ("python-toml" ,python-toml)
  420. ("python-semver" ,python-semver)
  421. ("python-ruamel.yaml" ,python-ruamel.yaml)
  422. ("python-requests" ,python-requests)
  423. ("python-json-logger" ,python-json-logger)
  424. ("python-jinja2" ,python-jinja2)
  425. ("python-escapism" ,python-escapism)
  426. ("python-docker" ,python-docker)))
  427. (native-inputs
  428. `(("python-sphinx" ,python-sphinx)
  429. ("python-recommonmark" ,python-recommonmark)
  430. ("python-sphinxcontrib-autoprogram" ,python-sphinxcontrib-autoprogram)
  431. ("python-pydata-sphinx-theme" ,python-pydata-sphinx-theme)))
  432. (home-page "https://repo2docker.readthedocs.io/en/latest/index.html#")
  433. (synopsis "Generate docker images from repositories")
  434. (description
  435. "repo2docker fetches a repository (from GitHub, GitLab, Zenodo, Figshare,
  436. Dataverse installations, a Git repository or a local directory) and builds a
  437. container image in which the code can be executed. The image build process is
  438. based on the configuration files found in the repository. repo2docker can be
  439. used to explore a repository locally by building and executing the constructed
  440. image of the repository, or as a means of building images that are pushed to a
  441. Docker registry.")
  442. (license license:bsd-3)))
  443. (define-public python-bash-kernel
  444. (package
  445. (name "python-bash-kernel")
  446. (version "0.7.2")
  447. (source (origin
  448. (method url-fetch)
  449. (uri (pypi-uri "bash_kernel" version))
  450. (sha256
  451. (base32
  452. "0w0nbr3iqqsgpk83rgd0f5b02462bkyj2n0h6i9dwyc1vpnq9350"))))
  453. (build-system python-build-system)
  454. (arguments
  455. `(#:tests? #f
  456. #:phases
  457. (modify-phases %standard-phases
  458. (add-after 'unpack 'bash-references
  459. (lambda* (#:key inputs #:allow-other-keys)
  460. (substitute* "bash_kernel/kernel.py"
  461. (("\"bash\"")
  462. (string-append "\"" (assoc-ref inputs "bash") "/bin/bash\""))
  463. (("\\['bash', ")
  464. (string-append "['" (assoc-ref inputs "bash") "/bin/bash', ")))
  465. #t))
  466. (add-after 'install 'install-kernelspec
  467. (lambda* (#:key outputs #:allow-other-keys)
  468. (let ((out (assoc-ref outputs "out")))
  469. (setenv "HOME" "/tmp")
  470. (invoke "python" "-m" "bash_kernel.install" "--prefix" out)
  471. #t))))))
  472. (inputs
  473. `(("bash" ,bash)))
  474. (propagated-inputs
  475. `(("python-pexpect" ,python-pexpect)
  476. ("python-ipykernel" ,python-ipykernel)
  477. ("python-jupyter-client" ,python-jupyter-client)))
  478. (home-page "https://github.com/takluyver/bash_kernel")
  479. (synopsis "Jupyter kernel for Bash")
  480. (description "A bash shell kernel for Jupyter.")
  481. (license license:expat)))
  482. (define-public python-sparqlkernel
  483. (package
  484. (name "python-sparqlkernel")
  485. (version "1.3.0")
  486. (source (origin
  487. (method url-fetch)
  488. (uri (pypi-uri "sparqlkernel" version))
  489. (sha256
  490. (base32
  491. "004v22nyi5cnpxq4fiws89p7i5wcnzv45n3n70axdd6prh6rkapx"))))
  492. (build-system python-build-system)
  493. (arguments
  494. `(#:tests? #f
  495. #:phases
  496. (modify-phases %standard-phases
  497. (add-after 'unpack 'no-custom-css
  498. (lambda* (#:key inputs #:allow-other-keys)
  499. (substitute* "sparqlkernel/install.py"
  500. (("install_custom_css\\( destd, PKGNAME \\)") ""))
  501. #t))
  502. (add-after 'install 'install-kernelspec
  503. (lambda* (#:key inputs outputs #:allow-other-keys)
  504. (let ((out (assoc-ref outputs "out")))
  505. (setenv "HOME" "/tmp")
  506. (add-installed-pythonpath inputs outputs)
  507. (invoke
  508. (string-append out "/bin/jupyter-sparqlkernel")
  509. "install"
  510. (string-append "--InstallKernelSpec.prefix=" out))
  511. #t))))))
  512. (native-inputs
  513. `(("python-traitlets" ,python-traitlets)
  514. ("python-jupyter-client" ,python-jupyter-client)
  515. ("python-notebook" ,python-notebook)
  516. ("python-ipykernel" ,python-ipykernel)
  517. ("python-html5lib" ,python-html5lib-0.9)))
  518. (propagated-inputs
  519. `(("python-sparqlwrapper" ,python-sparqlwrapper)
  520. ("python-pygments" ,python-pygments)))
  521. (home-page "https://github.com/paulovn/sparql-kernel")
  522. (synopsis "Jupyter kernel for SPARQL")
  523. (description "This module installs a Jupyter kernel for SPARQL. It allows
  524. sending queries to an SPARQL endpoint and fetching & presenting the results in
  525. a notebook.")
  526. (license license:bsd-3)))
  527. (define-public python-voila
  528. (package
  529. (name "python-voila")
  530. (version "0.2.10")
  531. (source
  532. (origin
  533. (method url-fetch)
  534. (uri (pypi-uri "voila" version))
  535. (sha256
  536. (base32
  537. "0krfc95yjlhjdmrsladhy6lpf4xs1zw49nmkyl4pkykndglvwa1m"))))
  538. (build-system python-build-system)
  539. (propagated-inputs
  540. `(("python-jupyter-client" ,python-jupyter-client)
  541. ("python-jupyter-server" ,python-jupyter-server)
  542. ("python-nbclient" ,python-nbclient)
  543. ("python-nbconvert" ,python-nbconvert)))
  544. (native-inputs
  545. `(("python-ipywidgets" ,python-ipywidgets)
  546. ("python-jupyter-packaging" ,python-jupyter-packaging)
  547. ("python-matplotlib" ,python-matplotlib)
  548. ("python-mock" ,python-mock)
  549. ("python-pytest" ,python-pytest)
  550. ("python-pytest-tornasync" ,python-pytest-tornasync)
  551. ("python-setuptools" ,python-setuptools)
  552. ("python-tornado" ,python-tornado-6)))
  553. (home-page "https://github.com/voila-dashboards/voila")
  554. (synopsis "Render live Jupyter notebooks with interactive widgets")
  555. (description
  556. "Voilà turns Jupyter notebooks into standalone web applications. Unlike
  557. the usual HTML-converted notebooks, each user connecting to the Voilà tornado
  558. application gets a dedicated Jupyter kernel which can execute the callbacks to
  559. changes in Jupyter interactive widgets.")
  560. (license license:bsd-3)))