gnu: python-ipykernel: Update to 6.13.0.

* gnu/packages/python-xyz.scm (python-ipykernel): Update to 6.13.0.
[origin]: Fix indentation.
[phases]: Use gexps.
{check}: Invoke pytest via tini
{set-python-file-name}: Adjust to use search-input-file.
[propagated-inputs]: Add python-debugpy, python-matplotlib-inline and
python-psutil.
[native-inputs]{python-nose}: Delete.
{python-ipyrallel-bootstrap}: New native input.
{python-pytest}: Replace with...
{python-pytest-bootstrap}: ... this.
{python-pytest-timeout, tini}: New native inputs.
This commit is contained in:
Maxim Cournoyer 2022-04-12 23:36:01 -04:00
parent f30bdda88f
commit 53e179c752
No known key found for this signature in database
GPG Key ID: 1260E46482E63562

View File

@ -9093,42 +9093,76 @@ installing @code{kernelspec}s for use with Jupyter frontends.")
(define-public python-ipykernel (define-public python-ipykernel
(package (package
(name "python-ipykernel") (name "python-ipykernel")
(version "5.5.3") (version "6.13.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "ipykernel" version)) (uri (pypi-uri "ipykernel" version))
(sha256 (sha256
(base32 "02f55cjkp5q64x7ikjxznbxwjpkdmfy237b9kg7dk1pxmzvy90m6")))) (base32 "0q5yni8h08nadsn53f957p0pjsjhwl2b2lp1hqz3jn0854z2fa0f"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:imported-modules `(,@%python-build-system-modules
(replace 'check (guix build syscalls))
(lambda* (#:key tests? #:allow-other-keys) #:modules '((guix build python-build-system)
(when tests? (guix build syscalls)
(setenv "HOME" "/tmp") (guix build utils)
(invoke "pytest" "-v")))) (ice-9 match))
(add-after 'install 'set-python-file-name #:phases
(lambda* (#:key outputs #:allow-other-keys) #~(modify-phases %standard-phases
;; Record the absolute file name of the 'python' executable in (replace 'check
;; 'kernel.json'. (lambda* (#:key tests? #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (when tests?
(substitute* (string-append out "/share/jupyter" (match (primitive-fork)
"/kernels/python3/kernel.json") (0 ;child process
(("\"python\"") (set-child-subreaper!)
(string-append "\"" (which "python") "\""))) ;; XXX: Tini provides proper PID1-like signal handling that
#t)))))) ;; reaps zombie processes, necessary for the
;; 'test_shutdown_subprocesses' test to pass.
;; TODO: Complete https://issues.guix.gnu.org/30948.
(setenv "HOME" "/tmp")
(execlp "tini" "--" "pytest" "-vv"))
(pid
(match (waitpid pid)
((_ . status)
(unless (zero? status)
(error "`pytest' exited with status"
status)))))))))
(add-after 'install 'set-python-file-name
(lambda* (#:key inputs #:allow-other-keys)
;; Record the absolute file name of the 'python' executable in
;; 'kernel.json'.
(substitute* (string-append #$output "/share/jupyter"
"/kernels/python3/kernel.json")
(("\"python\"")
(format #f "~s" (search-input-file inputs
"/bin/python3")))))))))
(propagated-inputs (propagated-inputs
(list python-ipython python-tornado-6 python-traitlets (list python-debugpy
;; imported at runtime during connect python-ipython
python-jupyter-client)) python-jupyter-client ;imported at runtime during connect
python-matplotlib-inline
;;python-nest-asyncio
;;python-packaging
python-psutil
python-tornado-6
python-traitlets))
(inputs (list python)) ;for cross compilation
(native-inputs (native-inputs
(list python-flaky python-nose python-pytest)) (list python-flaky
python-ipyparallel-bootstrap
;; XXX: Our Pytest package captures its native inputs in its
;; wrapper script (such as python-nose), which is used in the code
;; and causes deprecation warnings. Using the bootstrap variant
;; avoids that.
python-pytest-bootstrap
python-pytest-timeout
tini))
(home-page "https://ipython.org") (home-page "https://ipython.org")
(synopsis "IPython Kernel for Jupyter") (synopsis "IPython Kernel for Jupyter")
(description (description "This package provides the IPython kernel for Jupyter.")
"This package provides the IPython kernel for Jupyter.")
(license license:bsd-3))) (license license:bsd-3)))
;; Bootstrap variant of ipykernel, which uses the bootstrap jupyter-client to ;; Bootstrap variant of ipykernel, which uses the bootstrap jupyter-client to