[PATCH] gnu: Add python-jupyter-console as input to python-ipython.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 7 years ago
(address . guix-patches@gnu.org)
20171011090624.11181-1-mail@cbaines.net
This fixes running ipython console and ipython3 console.

As python-ipython is an input to python-jupyter-console, depend on a modified
version of the package which doesn't have this input.

* gnu/packages/python.scm (python-ipython)[propagated-inputs]: Add a modified
version of python-jupyter-console.
---
gnu/packages/python.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 8521ab352..6921a8944 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5851,6 +5851,31 @@ tools for mocking system commands and recording calls to those.")
("python-numpy" ,python-numpy)
("python-numpydoc" ,python-numpydoc)
("python-jinja2" ,python-jinja2)
+ ("python-jupyter-console"
+ ;; The python-ipython and python-jupyter-console require each
+ ;; other. To get the functionality in both packages working, strip
+ ;; down the python-jupyter-console package when using it as an input
+ ;; to python-ipython.
+ ,(package
+ (inherit python-jupyter-console)
+ (arguments
+ (substitute-keyword-arguments
+ (package-arguments python-jupyter-console)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'install 'delete-bin
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Delete the bin files, to avoid conflicts in profiles
+ ;; where python-ipython and python-jupyter-console are
+ ;; both present.
+ (delete-file-recursively
+ (string-append
+ (assoc-ref outputs "out") "/bin"))))))))
+ ;; Remove the python-ipython propagated input, to avoid the cycle
+ (propagated-inputs
+ (remove (lambda (input)
+ (string=? (car input) name))
+ (package-propagated-inputs python-jupyter-console)))))
("python-mistune" ,python-mistune)
("python-pexpect" ,python-pexpect)
("python-pickleshare" ,python-pickleshare)
--
2.14.2
Ludovic Courtès wrote 7 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28782@debbugs.gnu.org)
87efq9a26t.fsf@gnu.org
Hello,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (8 lines)
> This fixes running ipython console and ipython3 console.
>
> As python-ipython is an input to python-jupyter-console, depend on a modified
> version of the package which doesn't have this input.
>
> * gnu/packages/python.scm (python-ipython)[propagated-inputs]: Add a modified
> version of python-jupyter-console.

[...]

Toggle quote (30 lines)
> @@ -5851,6 +5851,31 @@ tools for mocking system commands and recording calls to those.")
> ("python-numpy" ,python-numpy)
> ("python-numpydoc" ,python-numpydoc)
> ("python-jinja2" ,python-jinja2)
> + ("python-jupyter-console"
> + ;; The python-ipython and python-jupyter-console require each
> + ;; other. To get the functionality in both packages working, strip
> + ;; down the python-jupyter-console package when using it as an input
> + ;; to python-ipython.
> + ,(package
> + (inherit python-jupyter-console)
> + (arguments
> + (substitute-keyword-arguments
> + (package-arguments python-jupyter-console)
> + ((#:phases phases)
> + `(modify-phases ,phases
> + (add-after 'install 'delete-bin
> + (lambda* (#:key outputs #:allow-other-keys)
> + ;; Delete the bin files, to avoid conflicts in profiles
> + ;; where python-ipython and python-jupyter-console are
> + ;; both present.
> + (delete-file-recursively
> + (string-append
> + (assoc-ref outputs "out") "/bin"))))))))
> + ;; Remove the python-ipython propagated input, to avoid the cycle
> + (propagated-inputs
> + (remove (lambda (input)
> + (string=? (car input) name))
> + (package-propagated-inputs python-jupyter-console)))))

For clarity, perhaps we should declare the above as
‘python-jupyter-console-minimal’ (also with a ‘name’ field)?

Also, the (remove …) expression at the end can be rewritten as:

(alist-delete name (package-propagated-inputs python-jupyter-console))

Otherwise LGTM, thanks!

Ludo’.
Christopher Baines wrote 7 years ago
(address . 28782-done@debbugs.gnu.org)
20171012202735.462934b2@cbaines.net
On Wed, 11 Oct 2017 21:56:26 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (61 lines)
> Hello,
>
> Christopher Baines <mail@cbaines.net> skribis:
>
> > This fixes running ipython console and ipython3 console.
> >
> > As python-ipython is an input to python-jupyter-console, depend on
> > a modified version of the package which doesn't have this input.
> >
> > * gnu/packages/python.scm (python-ipython)[propagated-inputs]: Add
> > a modified version of python-jupyter-console.
>
> [...]
>
> > @@ -5851,6 +5851,31 @@ tools for mocking system commands and
> > recording calls to those.") ("python-numpy" ,python-numpy)
> > ("python-numpydoc" ,python-numpydoc)
> > ("python-jinja2" ,python-jinja2)
> > + ("python-jupyter-console"
> > + ;; The python-ipython and python-jupyter-console require
> > each
> > + ;; other. To get the functionality in both packages
> > working, strip
> > + ;; down the python-jupyter-console package when using it
> > as an input
> > + ;; to python-ipython.
> > + ,(package
> > + (inherit python-jupyter-console)
> > + (arguments
> > + (substitute-keyword-arguments
> > + (package-arguments python-jupyter-console)
> > + ((#:phases phases)
> > + `(modify-phases ,phases
> > + (add-after 'install 'delete-bin
> > + (lambda* (#:key outputs #:allow-other-keys)
> > + ;; Delete the bin files, to avoid conflicts
> > in profiles
> > + ;; where python-ipython and
> > python-jupyter-console are
> > + ;; both present.
> > + (delete-file-recursively
> > + (string-append
> > + (assoc-ref outputs "out") "/bin"))))))))
> > + ;; Remove the python-ipython propagated input, to avoid
> > the cycle
> > + (propagated-inputs
> > + (remove (lambda (input)
> > + (string=? (car input) name))
> > + (package-propagated-inputs
> > python-jupyter-console)))))
>
> For clarity, perhaps we should declare the above as
> ‘python-jupyter-console-minimal’ (also with a ‘name’ field)?
>
> Also, the (remove …) expression at the end can be rewritten as:
>
> (alist-delete name (package-propagated-inputs
> python-jupyter-console))
>
> Otherwise LGTM, thanks!

Thanks for reviewing Ludo, I've made these changes and pushed :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlnfwidfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xexow//Sh6SvIqmPFVazgmHbr0f1yKsh/ATMNYJqMUhlzrqF0IkFzNHV6Q3cidf
AQWRcrXGo8n3qNBJNKTMXoSlfvfSepxSjxc9u+d5OQU+5NUYIM5A1lb+EgoWYFKL
BtItNL8fA7YQSMMNV4BH/f+KfbL79Pqr+0owFvPJJfBD62AL+hKGgPzY1LcFyBfz
iJwJc7OVhu5ns77wyEQNvsQYUMbb6dPw35HVWEeOmctcMIECovEJzdaDSyt8xxPQ
nm0lOK6VxqfoV1Am/dkY8ZEqnPX7/F/rLogEd06gMuwrskvhdwIS0Zy1lf9m5FMp
upU33udGGnU7lYJBWI2DJYZJvoUQjbx9yWw60+3D7c59oFcYQYKJHSEy4j3zFiMl
Ly0DKFsvnr9flMBIiuXZh3PgQjTKxz8GdWzQ25KHFedrb3vgzLx1ieKHIvGMVMGE
2HiU5NmPGmMh7it+pdY74Od/15+cjI3Pgi8yZqmIHIWu5EkhMxTr1eU2nzzfC1rG
u+0cvEtE4BVOZhtdR+kfXI0mxWPXHGcTv2b9yHbqd4rxUFCL1x+wa3lTYlQ5ripa
mr1QbvRDKtHZC6FGsUKhihw7t75hubsOHj5c/oxTJN+N5K8cMWwrDUktWKdCNqfl
uh+dYt+/+s37hrlYVjWE+Wezfij1PPKSfTwae8WGABYdl+1xAQA=
=bIsl
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 28782@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 28782
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help